|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwind.util.WWBufferUtil
public class WWBufferUtil
A collection of useful Buffer methods, all static.
| Field Summary | |
|---|---|
static int |
SIZEOF_CHAR
The size of a char primitive type, in bytes. |
| Constructor Summary | |
|---|---|
WWBufferUtil()
|
|
| Method Summary | |
|---|---|
static double[] |
computeExtremeValues(BufferWrapper buffer)
Returns the minimum and maximum floating point values in the specified buffer. |
static double[] |
computeExtremeValues(BufferWrapper buffer,
double missingDataSignal)
Returns the minimum and maximum floating point values in the specified buffer. |
static BufferWrapper |
copyOf(BufferWrapper buffer,
int newSize,
BufferFactory factory)
Returns a copy of the specified buffer, with the specified new size. |
static java.nio.ByteBuffer |
copyOf(java.nio.ByteBuffer buffer,
int newSize)
Returns a copy of the specified buffer, with the specified new size. |
static java.nio.CharBuffer |
copyOf(java.nio.CharBuffer buffer,
int newSize)
Returns a copy of the specified buffer, with the specified new size. |
static java.nio.DoubleBuffer |
copyOf(java.nio.DoubleBuffer buffer,
int newSize)
Returns a copy of the specified buffer, with the specified new size. |
static java.nio.FloatBuffer |
copyOf(java.nio.FloatBuffer buffer,
int newSize)
Returns a copy of the specified buffer, with the specified new size. |
static java.nio.IntBuffer |
copyOf(java.nio.IntBuffer buffer,
int newSize)
Returns a copy of the specified buffer, with the specified new size. |
static java.nio.ShortBuffer |
copyOf(java.nio.ShortBuffer buffer,
int newSize)
Returns a copy of the specified buffer, with the specified new size. |
static BufferWrapper |
newByteBufferWrapper(int size,
boolean allocateDirect)
Allocates a new BufferWrapper of the specified size, in bytes. |
static java.nio.CharBuffer |
newCharBuffer(int size)
Allocates a new direct CharBuffer of the specified size, in chars. |
static BufferWrapper |
newDoubleBufferWrapper(int size,
boolean allocateDirect)
Allocates a new BufferWrapper of the specified size, in doubles. |
static BufferWrapper |
newFloatBufferWrapper(int size,
boolean allocateDirect)
Allocates a new BufferWrapper of the specified size, in floats. |
static BufferWrapper |
newIntBufferWrapper(int size,
boolean allocateDirect)
Allocates a new BufferWrapper of the specified size, in ints. |
static BufferWrapper |
newShortBufferWrapper(int size,
boolean allocateDirect)
Allocates a new BufferWrapper of the specified size, in shorts. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SIZEOF_CHAR
| Constructor Detail |
|---|
public WWBufferUtil()
| Method Detail |
|---|
public static double[] computeExtremeValues(BufferWrapper buffer)
Double.NaN are ignored. This returns null if the buffer is empty or contains only NaN values.
buffer - the buffer to search for the minimum and maximum values.
java.lang.IllegalArgumentException - if the buffer is null.
public static double[] computeExtremeValues(BufferWrapper buffer,
double missingDataSignal)
missingDataSignal are ignored. This returns null if the buffer is empty or contains only missing
values.
buffer - the buffer to search for the minimum and maximum values.missingDataSignal - the number indicating a specific floating point value to ignore.
java.lang.IllegalArgumentException - if the buffer is null.
public static BufferWrapper copyOf(BufferWrapper buffer,
int newSize,
BufferFactory factory)
buffer - the buffer to copy.newSize - the new buffer's size, in doubles.factory - the factory used to create the new buffer.
java.lang.IllegalArgumentException - if the buffer is null, if the new size is negative, or if the new size is less
than the buffer's remaing elements.
public static java.nio.ByteBuffer copyOf(java.nio.ByteBuffer buffer,
int newSize)
buffer - the buffer to copy.newSize - the new buffer's size, in bytes.
java.lang.IllegalArgumentException - if the buffer is null, if the new size is negative, or if the new size is less
than the buffer's remaing elements.
public static java.nio.CharBuffer copyOf(java.nio.CharBuffer buffer,
int newSize)
buffer - the buffer to copy.newSize - the new buffer's size, in chars.
java.lang.IllegalArgumentException - if the buffer is null, if the new size is negative, or if the new size is less
than the buffer's remaing elements.
public static java.nio.DoubleBuffer copyOf(java.nio.DoubleBuffer buffer,
int newSize)
buffer - the buffer to copy.newSize - the new buffer's size, in doubles.
java.lang.IllegalArgumentException - if the buffer is null, if the new size is negative, or if the new size is less
than the buffer's remaing elements.
public static java.nio.FloatBuffer copyOf(java.nio.FloatBuffer buffer,
int newSize)
buffer - the buffer to copy.newSize - the new buffer's size, in floats.
java.lang.IllegalArgumentException - if the buffer is null, if the new size is negative, or if the new size is less
than the buffer's remaing elements.
public static java.nio.IntBuffer copyOf(java.nio.IntBuffer buffer,
int newSize)
buffer - the buffer to copy.newSize - the new buffer's size, in ints.
java.lang.IllegalArgumentException - if the buffer is null, if the new size is negative, or if the new size is less
than the buffer's remaing elements.
public static java.nio.ShortBuffer copyOf(java.nio.ShortBuffer buffer,
int newSize)
buffer - the buffer to copy.newSize - the new buffer's size, in shorts.
java.lang.IllegalArgumentException - if the buffer is null, if the new size is negative, or if the new size is less
than the buffer's remaing elements.
public static BufferWrapper newByteBufferWrapper(int size,
boolean allocateDirect)
BufferWrapper of the specified size, in bytes. The BufferWrapper is backed by a Buffer of
bytes.
size - the new BufferWrapper's size.allocateDirect - true to allocate and return a direct buffer, false to allocate and return a non-direct
buffer.
java.lang.IllegalArgumentException - if size is negative.public static java.nio.CharBuffer newCharBuffer(int size)
CharBuffer of the specified size, in chars.
size - the new buffer's size.
java.lang.IllegalArgumentException - if size is negative.
public static BufferWrapper newDoubleBufferWrapper(int size,
boolean allocateDirect)
BufferWrapper of the specified size, in doubles. The BufferWrapper is backed by a Buffer
of doubles.
size - the new BufferWrapper's size.allocateDirect - true to allocate and return a direct buffer, false to allocate and return a non-direct
buffer.
java.lang.IllegalArgumentException - if size is negative.
public static BufferWrapper newFloatBufferWrapper(int size,
boolean allocateDirect)
BufferWrapper of the specified size, in floats. The BufferWrapper is backed by a Buffer
of floats.
size - the new BufferWrapper's size.allocateDirect - true to allocate and return a direct buffer, false to allocate and return a non-direct
buffer.
java.lang.IllegalArgumentException - if size is negative.
public static BufferWrapper newIntBufferWrapper(int size,
boolean allocateDirect)
BufferWrapper of the specified size, in ints. The BufferWrapper is backed by a Buffer of
ints.
size - the new BufferWrapper's size.allocateDirect - true to allocate and return a direct buffer, false to allocate and return a non-direct
buffer.
java.lang.IllegalArgumentException - if size is negative.
public static BufferWrapper newShortBufferWrapper(int size,
boolean allocateDirect)
BufferWrapper of the specified size, in shorts. The BufferWrapper is backed by a Buffer
of shorts.
size - the new BufferWrapper's size.allocateDirect - true to allocate and return a direct buffer, false to allocate and return a non-direct
buffer.
java.lang.IllegalArgumentException - if size is negative.
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||