Package com.esri.core.geometry
Class AttributeStreamOfInt32
- java.lang.Object
-
- com.esri.core.geometry.AttributeStreamBase
-
- com.esri.core.geometry.AttributeStreamOfInt32
-
- All Implemented Interfaces:
java.io.Serializable
final class AttributeStreamOfInt32 extends AttributeStreamBase implements java.io.Serializable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAttributeStreamOfInt32.IntComparator(package private) static classAttributeStreamOfInt32.RandomSeed
-
Field Summary
Fields Modifier and Type Field Description private int[]m_bufferprivate intm_sizeprivate static longserialVersionUID-
Fields inherited from class com.esri.core.geometry.AttributeStreamBase
m_bLockedInSize, m_bReadonly
-
-
Constructor Summary
Constructors Constructor Description AttributeStreamOfInt32(int size)AttributeStreamOfInt32(int size, int defaultValue)AttributeStreamOfInt32(AttributeStreamOfInt32 other)AttributeStreamOfInt32(AttributeStreamOfInt32 other, int maxSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void_selfWriteRangeImpl(int toElement, int count, int fromElement, boolean bForward, int stride)voidadd(int v)Adds a new value at the end of the stream.voidaddRange(AttributeStreamBase src, int start, int count, boolean bForward, int stride)Adds a range of elements from the source stream.intcalculateHashImpl(int hashCode, int start, int end)intcapacity()booleanequals(AttributeStreamBase other, int start, int end)voideraseRange(int index, int count, int validSize)Erases a range from the buffer and defragments the result.longestimateMemorySize()Returns an estimate of this object size in bytes.(package private) intfindElement(int value)intget(int offset)intgetLast()intgetPersistence()Returns the Persistence type of the stream.(package private) booleanhasElement(int value)voidinsertAttributes(int start, Point pt, int semantics, int validSize)Inserts the attributes of a given semantics from a Point geometry.(package private) voidinsertionsort(int start, int end, AttributeStreamOfInt32.IntComparator compare)voidinsertRange(int start, double value, int count, int validSize)Inserts a range of elements of the given value.voidinsertRange(int start, AttributeStreamBase src, int srcStart, int count, boolean bForward, int stride, int validSize)Inserts a range of elements from the source stream.(package private) voidpopElement(int index)(package private) voidquicksort(int leftIn, int rightIn, AttributeStreamOfInt32.IntComparator compare, AttributeStreamOfInt32.RandomSeed seed)intread(int offset)Reads a value from the buffer at given offset.doublereadAsDbl(int offset)Reads given element and returns it as double.intreadAsInt(int offset)Reads given element and returns it as int (truncated if double).longreadAsInt64(int offset)Reads given element and returns it as int (truncated if double).private voidreadObject(java.io.ObjectInputStream stream)private voidreadObjectNoData()voidreadRange(int srcStart, int count, java.nio.ByteBuffer dst, int dstOffset, boolean bForward)Write a range of elements to the source byte buffer.voidremoveLast()voidreserve(int reserve)voidresize(int newSize)Resizes the AttributeStream to the new size.voidresize(int newSize, double defaultValue)Resizes the AttributeStream to the new size.voidresizePreserveCapacity(int newSize)Resizes the AttributeStream to the new size.AttributeStreamBaserestrictedClone(int maxsize)Creats a copy of the stream that contains upto maxsize elements.voidreverseRange(int index, int count, int stride)Reverses a range from the buffer.voidset(int offset, int value)voidsetLast(int v)voidsetRange(double value, int start, int count)Sets a range of values to given value.intsize()voidsort(int start, int end)voidSort(int start, int end, AttributeStreamOfInt32.IntComparator compare)(package private) voidswap(int left, int right)intvirtualSize()Returns the number of elements in the stream.voidwrite(int offset, int value)Overwrites given element with new value.voidwriteAsDbl(int offset, double d)Writes given element as double.voidwriteAsInt(int offset, int d)Writes given element as int.voidwriteAsInt64(int offset, long d)Writes given element as int.private voidwriteObject(java.io.ObjectOutputStream stream)voidwriteRange(int startElement, int count, AttributeStreamBase _src, int srcStart, boolean bForward, int stride)Adds a range of elements from the source byte buffer.voidwriteRange(int startElement, int count, java.nio.ByteBuffer src, int offsetBytes, boolean bForward)Adds a range of elements from the source byte buffer.-
Methods inherited from class com.esri.core.geometry.AttributeStreamBase
clear, createAttributeStreamWithPersistence, createAttributeStreamWithPersistence, createAttributeStreamWithSemantics, createByteStream, createByteStream, createDoubleStream, createDoubleStream, createIndexStream, createIndexStream, isLockedSize, isReadonly, lockSize, setReadonly
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
m_buffer
private transient int[] m_buffer
-
m_size
private int m_size
-
-
Constructor Detail
-
AttributeStreamOfInt32
public AttributeStreamOfInt32(int size)
-
AttributeStreamOfInt32
public AttributeStreamOfInt32(int size, int defaultValue)
-
AttributeStreamOfInt32
public AttributeStreamOfInt32(AttributeStreamOfInt32 other)
-
AttributeStreamOfInt32
public AttributeStreamOfInt32(AttributeStreamOfInt32 other, int maxSize)
-
-
Method Detail
-
reserve
public void reserve(int reserve)
-
size
public int size()
-
capacity
public int capacity()
-
read
public int read(int offset)
Reads a value from the buffer at given offset.- Parameters:
offset- is the element number in the stream.
-
get
public int get(int offset)
-
write
public void write(int offset, int value)Overwrites given element with new value.- Parameters:
offset- is the element number in the stream.value- is the value to write.
-
set
public void set(int offset, int value)
-
add
public void add(int v)
Adds a new value at the end of the stream.- Parameters:
offset- is the element number in the stream.value- is the value to write.
-
restrictedClone
public AttributeStreamBase restrictedClone(int maxsize)
Description copied from class:AttributeStreamBaseCreats a copy of the stream that contains upto maxsize elements.- Specified by:
restrictedClonein classAttributeStreamBase
-
virtualSize
public int virtualSize()
Description copied from class:AttributeStreamBaseReturns the number of elements in the stream.- Specified by:
virtualSizein classAttributeStreamBase
-
estimateMemorySize
public long estimateMemorySize()
Description copied from class:AttributeStreamBaseReturns an estimate of this object size in bytes.- Specified by:
estimateMemorySizein classAttributeStreamBase- Returns:
- Returns an estimate of this object size in bytes.
-
getPersistence
public int getPersistence()
Description copied from class:AttributeStreamBaseReturns the Persistence type of the stream.- Specified by:
getPersistencein classAttributeStreamBase
-
readAsDbl
public double readAsDbl(int offset)
Description copied from class:AttributeStreamBaseReads given element and returns it as double.- Specified by:
readAsDblin classAttributeStreamBase
-
readAsInt
public int readAsInt(int offset)
Description copied from class:AttributeStreamBaseReads given element and returns it as int (truncated if double).- Specified by:
readAsIntin classAttributeStreamBase
-
readAsInt64
public long readAsInt64(int offset)
Description copied from class:AttributeStreamBaseReads given element and returns it as int (truncated if double).- Specified by:
readAsInt64in classAttributeStreamBase
-
resize
public void resize(int newSize)
Description copied from class:AttributeStreamBaseResizes the AttributeStream to the new size.- Specified by:
resizein classAttributeStreamBase
-
resizePreserveCapacity
public void resizePreserveCapacity(int newSize)
Description copied from class:AttributeStreamBaseResizes the AttributeStream to the new size. Does not change the capacity of the stream.- Specified by:
resizePreserveCapacityin classAttributeStreamBase
-
resize
public void resize(int newSize, double defaultValue)Description copied from class:AttributeStreamBaseResizes the AttributeStream to the new size.- Specified by:
resizein classAttributeStreamBase
-
writeAsDbl
public void writeAsDbl(int offset, double d)Description copied from class:AttributeStreamBaseWrites given element as double. The double is cast to the internal representation (truncated when int).- Specified by:
writeAsDblin classAttributeStreamBase
-
writeAsInt64
public void writeAsInt64(int offset, long d)Description copied from class:AttributeStreamBaseWrites given element as int. The int is cast to the internal representation.- Specified by:
writeAsInt64in classAttributeStreamBase
-
writeAsInt
public void writeAsInt(int offset, int d)Description copied from class:AttributeStreamBaseWrites given element as int. The int is cast to the internal representation.- Specified by:
writeAsIntin classAttributeStreamBase
-
calculateHashImpl
public int calculateHashImpl(int hashCode, int start, int end)- Specified by:
calculateHashImplin classAttributeStreamBase
-
equals
public boolean equals(AttributeStreamBase other, int start, int end)
- Specified by:
equalsin classAttributeStreamBase
-
getLast
public int getLast()
-
setLast
public void setLast(int v)
-
removeLast
public void removeLast()
-
findElement
int findElement(int value)
-
hasElement
boolean hasElement(int value)
-
popElement
void popElement(int index)
-
addRange
public void addRange(AttributeStreamBase src, int start, int count, boolean bForward, int stride)
Description copied from class:AttributeStreamBaseAdds a range of elements from the source stream. The streams must be of the same type.- Specified by:
addRangein classAttributeStreamBase- Parameters:
src- The source stream to read elements from.start- The index of the element in the source stream to start reading from.count- The number of elements to add.bForward- True if adding the elements in order of the incoming source stream. False if adding the elements in reverse.stride- The number of elements to be grouped together if adding the elements in reverse.
-
insertRange
public void insertRange(int start, AttributeStreamBase src, int srcStart, int count, boolean bForward, int stride, int validSize)Description copied from class:AttributeStreamBaseInserts a range of elements from the source stream. The streams must be of the same type.- Specified by:
insertRangein classAttributeStreamBase- Parameters:
start- The index where to start the insert.src- The source stream to read elements from.srcStart- The index of the element in the source stream to start reading from.count- The number of elements to read from the source stream.validSize- The number of valid elements in this stream.
-
insertRange
public void insertRange(int start, double value, int count, int validSize)Description copied from class:AttributeStreamBaseInserts a range of elements of the given value.- Specified by:
insertRangein classAttributeStreamBase- Parameters:
start- The index where to start the insert.value- The value to be inserted.count- The number of elements to be inserted.validSize- The number of valid elements in this stream.
-
insertAttributes
public void insertAttributes(int start, Point pt, int semantics, int validSize)Description copied from class:AttributeStreamBaseInserts the attributes of a given semantics from a Point geometry.- Specified by:
insertAttributesin classAttributeStreamBase- Parameters:
start- The index where to start the insert.pt- The Point geometry holding the attributes to be inserted.semantics- The attribute semantics that are being inserted.validSize- The number of valid elements in this stream.
-
eraseRange
public void eraseRange(int index, int count, int validSize)Description copied from class:AttributeStreamBaseErases a range from the buffer and defragments the result.- Specified by:
eraseRangein classAttributeStreamBase- Parameters:
index- The index in this stream where the erasing starts.count- The number of elements to be erased.validSize- The number of valid elements in this stream.
-
readRange
public void readRange(int srcStart, int count, java.nio.ByteBuffer dst, int dstOffset, boolean bForward)Description copied from class:AttributeStreamBaseWrite a range of elements to the source byte buffer.- Specified by:
readRangein classAttributeStreamBase- Parameters:
srcStart- The element index to start writing from.count- The number of AttributeStream elements to write.dst- The destination ByteBuffer. The buffer must be large enough or it will throw.dstOffset- The offset in the destination ByteBuffer to start write elements from.
-
reverseRange
public void reverseRange(int index, int count, int stride)Description copied from class:AttributeStreamBaseReverses a range from the buffer.- Specified by:
reverseRangein classAttributeStreamBase- Parameters:
index- The index in this stream where the reversing starts.count- The number of elements to be reversed.stride- The number of elements to be grouped together when doing the reverse.
-
setRange
public void setRange(double value, int start, int count)Description copied from class:AttributeStreamBaseSets a range of values to given value.- Specified by:
setRangein classAttributeStreamBase- Parameters:
value- The value to set stream elements to.start- The index of the element to start writing to.count- The number of elements to set.
-
writeRange
public void writeRange(int startElement, int count, AttributeStreamBase _src, int srcStart, boolean bForward, int stride)Description copied from class:AttributeStreamBaseAdds a range of elements from the source byte buffer. This stream is resized automatically to accomodate required number of elements.- Specified by:
writeRangein classAttributeStreamBase- Parameters:
startElement- the index of the element in this stream to start setting elements from.count- The number of AttributeStream elements to read._src- The source ByteBuffer to read elements from.srcStart- The offset from the start of the ByteBuffer in bytes.bForward- When False, the source is written in reversed order.stride- Used for reversed writing only to indicate the unit of writing. elements inside a stride are not reversed. Only the strides are reversed.
-
_selfWriteRangeImpl
private void _selfWriteRangeImpl(int toElement, int count, int fromElement, boolean bForward, int stride)
-
writeRange
public void writeRange(int startElement, int count, java.nio.ByteBuffer src, int offsetBytes, boolean bForward)Description copied from class:AttributeStreamBaseAdds a range of elements from the source byte buffer. The stream is resized automatically to accomodate required number of elements.- Specified by:
writeRangein classAttributeStreamBase- Parameters:
startElement- the index of the element in this stream to start setting elements from.count- The number of AttributeStream elements to read.src- The source ByteBuffer to read elements from.offsetBytes- The offset from the start of the ByteBuffer in bytes.
-
Sort
public void Sort(int start, int end, AttributeStreamOfInt32.IntComparator compare)
-
insertionsort
void insertionsort(int start, int end, AttributeStreamOfInt32.IntComparator compare)
-
swap
void swap(int left, int right)
-
quicksort
void quicksort(int leftIn, int rightIn, AttributeStreamOfInt32.IntComparator compare, AttributeStreamOfInt32.RandomSeed seed)
-
sort
public void sort(int start, int end)
-
writeObject
private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOException- Throws:
java.io.IOException
-
readObject
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, java.lang.ClassNotFoundException- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
readObjectNoData
private void readObjectNoData() throws java.io.ObjectStreamException- Throws:
java.io.ObjectStreamException
-
-