Class ShortArrayBuffer
java.lang.Object
com.oracle.truffle.regex.tregex.buffer.AbstractArrayBuffer
com.oracle.truffle.regex.tregex.buffer.ShortArrayBuffer
This class is designed as a "scratchpad" for generating many short arrays of unknown size. It
will never shrink its internal buffer, so it should be disposed as soon as it is no longer
needed.
Usage Example:
ShortArrayBuffer buf = new ShortArrayBuffer();
List<short[]> results = new ArrayList<>();
for (Object obj : listOfThingsToProcess) {
for (Object x : obj.thingsThatShouldBecomeShorts()) {
buf.add(someCalculation(x));
}
results.add(buf.toArray());
buf.clear();
}
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.oracle.truffle.regex.tregex.buffer.AbstractArrayBuffer
clear, ensureCapacity, isEmpty, length, setLengthMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ShortArrayBuffer
public ShortArrayBuffer() -
ShortArrayBuffer
public ShortArrayBuffer(int initialSize)
-
-
Method Details