From 4d81fc60357f2bcce64d56d4fd871538b677ade5 Mon Sep 17 00:00:00 2001 From: Stephen Gold Date: Sat, 18 Apr 2020 13:15:08 -0700 Subject: [PATCH] add some missing javadoc (2 files in com.jme3.util) --- .../java/com/jme3/util/BufferAllocator.java | 13 +++++++++++-- .../java/com/jme3/util/PrimitiveAllocator.java | 17 +++++++++++++---- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/jme3-core/src/main/java/com/jme3/util/BufferAllocator.java b/jme3-core/src/main/java/com/jme3/util/BufferAllocator.java index e7d429db6..4ac98eca6 100644 --- a/jme3-core/src/main/java/com/jme3/util/BufferAllocator.java +++ b/jme3-core/src/main/java/com/jme3/util/BufferAllocator.java @@ -4,9 +4,18 @@ import java.nio.Buffer; import java.nio.ByteBuffer; public interface BufferAllocator { - + /** + * De-allocate a direct buffer. + * + * @param toBeDestroyed the buffer to de-allocate (not null) + */ void destroyDirectBuffer(Buffer toBeDestroyed); + /** + * Allocate a direct ByteBuffer of the specified size. + * + * @param size in bytes (≥0) + * @return a new direct buffer + */ ByteBuffer allocate(int size); - } diff --git a/jme3-core/src/main/java/com/jme3/util/PrimitiveAllocator.java b/jme3-core/src/main/java/com/jme3/util/PrimitiveAllocator.java index 9762dc158..860a6536b 100644 --- a/jme3-core/src/main/java/com/jme3/util/PrimitiveAllocator.java +++ b/jme3-core/src/main/java/com/jme3/util/PrimitiveAllocator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,17 +39,26 @@ import java.nio.ByteBuffer; * on any jvm */ public final class PrimitiveAllocator implements BufferAllocator { - + /** + * De-allocate a direct buffer. + * + * @param toBeDestroyed ignored + */ @Override public void destroyDirectBuffer(Buffer toBeDestroyed) { - // no exception by intent, as this way naivly written java7/8 + // no exception by intent, as this way naively written java7/8 // applications won't crash on 9 assuming they can dispose buffers System.err.println("Warning destroyBuffer not supported"); } + /** + * Allocate a direct ByteBuffer of the specified size. + * + * @param size in bytes (≥0) + * @return a new direct buffer + */ @Override public ByteBuffer allocate(int size) { return ByteBuffer.allocateDirect(size); } - }