| Modifier and Type | Field and Description |
|---|---|
| protected int | m_blocksize
Size of blocks to allocate |
| protected int | m_firstFree
Number of bytes in array |
| protected byte[][] | m_map
Array of arrays of bytes |
| protected byte[] | m_map0
"Shortcut" handle to m_map[0] |
| protected int | m_numblocks
Number of blocks to (over)allocate by |
| Access | Constructor and Description |
|---|---|
| public | |
| public | SuballocatedByteVector(int
Size of block to allocate blocksize)Construct a ByteVector, using the given block size. |
| public | SuballocatedByteVector(int
Size of block to allocate blocksize, int increaseSize)Construct a ByteVector, using the given block size. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private void | addElements(byte
Byte to add to the list value, int numberOfElements)Append several byte values onto the vector. |
| private void | |
| private boolean | Returns: true if the object is in the listobject to look for s)Tell if the table contains the given node. |
| public byte | Returns: value at given index. If that value wasn't previously set, the result is undefined for performance reasons. It may throw an exception (see below), may return zero, or (if setSize has previously been used) may return stale data.index of value to get i)Get the nth element. |
| public int | Returns: the index of the first occurrence of the object argument in this vector at position index or later in the vector; returns -1 if the object is not found.object to look for elem, int Index of where to begin search index)Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method. |
| public int | Returns: the index of the first occurrence of the object argument in this vector at position index or later in the vector; returns -1 if the object is not found.object to look for elem)Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method. |
| private void | insertElementAt(byte
Byte to insert value, int Index of where to insert at)Inserts the specified node in this vector at the specified index. |
| private int | Returns: the index of the first occurrence of the object argument in this vector at position index or later in the vector; returns -1 if the object is not found.Object to look for elem)Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method. |
| public void | |
| private boolean | Returns: True if the byte was removed, false if it was not foundByte to remove from array s)Removes the first occurrence of the argument from this vector. |
| private void | |
| public void | setElementAt(byte value, int
Index of where to set the object at)Sets the component at the specified index of this vector to be the specified object. |
| private void | |
| public int |
| m_blocksize | back to summary |
|---|---|
| protected int m_blocksize Size of blocks to allocate | |
| m_firstFree | back to summary |
|---|---|
| protected int m_firstFree Number of bytes in array | |
| m_map | back to summary |
|---|---|
| protected byte[][] m_map Array of arrays of bytes | |
| m_map0 | back to summary |
|---|---|
| protected byte[] m_map0 "Shortcut" handle to m_map[0] | |
| m_numblocks | back to summary |
|---|---|
| protected int m_numblocks Number of blocks to (over)allocate by | |
| SuballocatedByteVector | back to summary |
|---|---|
| public SuballocatedByteVector() Default constructor. Note that the default block size is very small, for small lists. | |
| SuballocatedByteVector | back to summary |
|---|---|
| public SuballocatedByteVector(int blocksize) Construct a ByteVector, using the given block size.
| |
| SuballocatedByteVector | back to summary |
|---|---|
| public SuballocatedByteVector(int blocksize, int increaseSize) Construct a ByteVector, using the given block size.
| |
| addElement | back to summary |
|---|---|
| public void addElement(byte value) Append a byte onto the vector.
| |
| addElements | back to summary |
|---|---|
| private void addElements(byte value, int numberOfElements) Append several byte values onto the vector.
| |
| addElements | back to summary |
|---|---|
| private void addElements(int numberOfElements) Append several slots onto the vector, but do not set the values. Note "Not Set" means the value is unspecified. | |
| contains | back to summary |
|---|---|
| private boolean contains(byte s) Tell if the table contains the given node.
| |
| elementAt | back to summary |
|---|---|
| public byte elementAt(int i) Get the nth element. This is often at the innermost loop of an application, so performance is critical.
| |
| indexOf | back to summary |
|---|---|
| public int indexOf(byte elem, int index) Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method.
| |
| indexOf | back to summary |
|---|---|
| public int indexOf(byte elem) Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method.
| |
| insertElementAt | back to summary |
|---|---|
| private void insertElementAt(byte value, int at) Inserts the specified node in this vector at the specified index. Each component in this vector with an index greater or equal to the specified index is shifted upward to have an index one greater than the value it had previously. Insertion may be an EXPENSIVE operation!
| |
| lastIndexOf | back to summary |
|---|---|
| private int lastIndexOf(byte elem) Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method.
| |
| removeAllElements | back to summary |
|---|---|
| public void removeAllElements() Wipe it out. | |
| removeElement | back to summary |
|---|---|
| private boolean removeElement(byte s) Removes the first occurrence of the argument from this vector. If the object is found in this vector, each component in the vector with an index greater or equal to the object's index is shifted downward to have an index one smaller than the value it had previously.
| |
| removeElementAt | back to summary |
|---|---|
| private void removeElementAt(int at) Deletes the component at the specified index. Each component in this vector with an index greater or equal to the specified index is shifted downward to have an index one smaller than the value it had previously.
| |
| setElementAt | back to summary |
|---|---|
| public void setElementAt(byte value, int at) Sets the component at the specified index of this vector to be the specified object. The previous component at that position is discarded. The index must be a value greater than or equal to 0 and less than the current size of the vector.
| |
| setSize | back to summary |
|---|---|
| private void setSize(int sz) Set the length of the list.
| |
| size | back to summary |
|---|---|
| public int size() Get the length of the list.
| |