| Modifier and Type | Field and Description |
|---|---|
| private int | actualSizeInWords
The actual size in words. |
| private int[] | buffer
The buffer (array of 32-bit words) |
| private static final int | DEFAULT_BUFFER_SIZE
The Constant DEFAULT_BUFFER_SIZE: default memory allocation when the object is constructed. |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | andLastWord(int mask)
Implements com. Replaces the last word position in the buffer with its bitwise-and with the given mask. |
| public void | andWord(int position, int mask)
Implements com. Replaces the word at the given position in the buffer with its bitwise-and with the given mask. |
| public void | clear()
Implements com. Resets the buffer The buffer is not fully cleared and any new set operations should overwrite stale data |
| public IntArray | clone()
Overrides java. Implements com. Creates and returns a copy of the buffer |
| public void | collapse(int
the position of the buffer where to add words position, int the number of words to add length)Implements com. Removes a given number of words at the given position in the buffer. |
| public void | ensureCapacity(int capacity)
Implements com. Increases the size of the buffer if necessary |
| public void | expand(int
the position of the buffer where to add words position, int the number of words to add length)Implements com. Expands the buffer by adding the given number of words at the given position. |
| public int | getLastWord()
Implements com. Returns the last word of the buffer |
| public int | getWord(int position)
Implements com. Returns the word at a given position |
| public void | negateWord(int position)
Implements com. Negates the word at the given position in the buffer |
| public void | negative_push_back(Buffer32
the buffer buffer, int the position of the first word to add start, int the number of words to add number)Implements com. Same as push_back, but the words are negated. |
| private int | newSizeInWords(int
the number of words to add number)Returns the resulting buffer size in words given the number of words to add. |
| public void | orLastWord(int mask)
Implements com. Replaces the last word position in the buffer with its bitwise-or with the given mask. |
| public void | orWord(int position, int mask)
Implements com. Replaces the word at the given position in the buffer with its bitwise-or with the given mask. |
| public void | push_back(int word)
Implements com. Appends the specified word to the end of the buffer |
| public void | push_back(Buffer32
the buffer buffer, int the position of the first word to add start, int the number of words to add number)Implements com. Appends the specified buffer words to the end of the buffer. |
| public void | removeLastWord()
Implements com. Removes the last word from the buffer |
| private void | resizeBuffer(int
the number of words to add number)Resizes the buffer if the number of words to add exceeds the buffer capacity. |
| public void | setLastWord(int word)
Implements com. Replaces the last word in the buffer with the specified word. |
| public void | setWord(int position, int word)
Implements com. Replaces the word at the given position in the buffer with the specified word. |
| public int | sizeInWords()
Implements com. Returns the actual size in words |
| public void | swap(final Buffer32
buffer to swap with other)Implements com. Swap the content of the buffer with another. |
| public void | trim()
Implements com. Reduces the internal buffer to its minimal allowable size. |
| actualSizeInWords | back to summary |
|---|---|
| private int actualSizeInWords The actual size in words. | |
| buffer | back to summary |
|---|---|
| private int[] buffer The buffer (array of 32-bit words) | |
| DEFAULT_BUFFER_SIZE | back to summary |
|---|---|
| private static final int DEFAULT_BUFFER_SIZE The Constant DEFAULT_BUFFER_SIZE: default memory allocation when the object is constructed. | |
| IntArray | back to summary |
|---|---|
| public IntArray() Creates a buffer with default size | |
| IntArray | back to summary |
|---|---|
| public IntArray(int bufferSize) Creates a buffer with explicit size | |
| andLastWord | back to summary |
|---|---|
| public void andLastWord(int mask) Implements com. Doc from com. Replaces the last word position in the buffer with its bitwise-and with the given mask.
| |
| andWord | back to summary |
|---|---|
| public void andWord(int position, int mask) Implements com. Doc from com. Replaces the word at the given position in the buffer with its bitwise-and with the given mask.
| |
| clear | back to summary |
|---|---|
| public void clear() Implements com. Doc from com. Resets the buffer The buffer is not fully cleared and any new set operations should overwrite stale data
| |
| clone | back to summary |
|---|---|
| public IntArray clone() Overrides java. Implements com. Doc from com. Creates and returns a copy of the buffer
| |
| collapse | back to summary |
|---|---|
| public void collapse(int position, int length) Implements com. Doc from com. Removes a given number of words at the given position in the buffer. The freed words at the end of the buffer are properly cleaned.
| |
| ensureCapacity | back to summary |
|---|---|
| public void ensureCapacity(int capacity) Implements com. Doc from com. Increases the size of the buffer if necessary
| |
| expand | back to summary |
|---|---|
| public void expand(int position, int length) Implements com. Doc from com. Expands the buffer by adding the given number of words at the given position. The added words may contain stale data.
| |
| getLastWord | back to summary |
|---|---|
| public int getLastWord() Implements com. Doc from com. Returns the last word of the buffer
| |
| getWord | back to summary |
|---|---|
| public int getWord(int position) Implements com. Doc from com. Returns the word at a given position
| |
| negateWord | back to summary |
|---|---|
| public void negateWord(int position) Implements com. Doc from com. Negates the word at the given position in the buffer
| |
| negative_push_back | back to summary |
|---|---|
| public void negative_push_back(Buffer32 buffer, int start, int number) Implements com. Doc from com. Same as push_back, but the words are negated. | |
| newSizeInWords | back to summary |
|---|---|
| private int newSizeInWords(int number) Returns the resulting buffer size in words given the number of words to add.
| |
| orLastWord | back to summary |
|---|---|
| public void orLastWord(int mask) Implements com. Doc from com. Replaces the last word position in the buffer with its bitwise-or with the given mask.
| |
| orWord | back to summary |
|---|---|
| public void orWord(int position, int mask) Implements com. Doc from com. Replaces the word at the given position in the buffer with its bitwise-or with the given mask.
| |
| push_back | back to summary |
|---|---|
| public void push_back(int word) Implements com. Doc from com. Appends the specified word to the end of the buffer
| |
| push_back | back to summary |
|---|---|
| public void push_back(Buffer32 buffer, int start, int number) Implements com. Doc from com. Appends the specified buffer words to the end of the buffer. | |
| removeLastWord | back to summary |
|---|---|
| public void removeLastWord() Implements com. Doc from com. Removes the last word from the buffer
| |
| resizeBuffer | back to summary |
|---|---|
| private void resizeBuffer(int number) Resizes the buffer if the number of words to add exceeds the buffer capacity.
| |
| setLastWord | back to summary |
|---|---|
| public void setLastWord(int word) Implements com. Doc from com. Replaces the last word in the buffer with the specified word.
| |
| setWord | back to summary |
|---|---|
| public void setWord(int position, int word) Implements com. Doc from com. Replaces the word at the given position in the buffer with the specified word.
| |
| sizeInWords | back to summary |
|---|---|
| public int sizeInWords() Implements com. Doc from com. Returns the actual size in words
| |
| swap | back to summary |
|---|---|
| public void swap(final Buffer32 other) Implements com. Doc from com. Swap the content of the buffer with another. | |
| trim | back to summary |
|---|---|
| public void trim() Implements com. Doc from com. Reduces the internal buffer to its minimal allowable size. This can free memory.
| |