Top Description Methods
com.googlecode.javaewah

pack-priv Interface Buffer

Known Direct Implementers
com.googlecode.javaewah.LongArray, com.googlecode.javaewah.LongBufferWrapper

Buffer interface. Users should not be concerned by this class.
Author
Gregory Ssi-Yan-Kai

Method Summary

Modifier and TypeMethod and Description
public void
andLastWord(long mask)

Replaces the last word position in the buffer with its bitwise-and with the given mask.

public void
andWord(int position, long mask)

Replaces the word at the given position in the buffer with its bitwise-and with the given mask.

public void
clear()

Resets the buffer The buffer is not fully cleared and any new set operations should overwrite stale data

public Buffer
clone()

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
)

Removes a given number of words at the given position in the buffer.

public void
ensureCapacity(int capacity)

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
)

Expands the buffer by adding the given number of words at the given position.

public long

Returns:

the last word
getLastWord
()

Returns the last word of the buffer

public long

Returns:

the word
getWord
(int position)

Returns the word at a given position

public void
negateWord(int position)

Negates the word at the given position in the buffer

public void
negative_push_back(Buffer
the buffer
buffer
,
int
the position of the first word to add
start
,
int
the number of words to add
number
)

Same as push_back, but the words are negated.

public void
orLastWord(long mask)

Replaces the last word position in the buffer with its bitwise-or with the given mask.

public void
orWord(int position, long mask)

Replaces the word at the given position in the buffer with its bitwise-or with the given mask.

public void
push_back(long word)

Appends the specified word to the end of the buffer

public void
push_back(Buffer
the buffer
buffer
,
int
the position of the first word to add
start
,
int
the number of words to add
number
)

Appends the specified buffer words to the end of the buffer.

public void
removeLastWord()

Removes the last word from the buffer

public void
setLastWord(long word)

Replaces the last word in the buffer with the specified word.

public void
setWord(int position, long word)

Replaces the word at the given position in the buffer with the specified word.

public int
sizeInWords()

Returns the actual size in words

public void
swap(Buffer
buffer to swap with
other
)

Swap the content of the buffer with another.

public void
trim()

Reduces the internal buffer to its minimal allowable size.

Method Detail

andLastWordback to summary
public void andLastWord(long mask)

Replaces the last word position in the buffer with its bitwise-and with the given mask.

andWordback to summary
public void andWord(int position, long mask)

Replaces the word at the given position in the buffer with its bitwise-and with the given mask.

clearback to summary
public void clear()

Resets the buffer The buffer is not fully cleared and any new set operations should overwrite stale data

cloneback to summary
public Buffer clone() throws CloneNotSupportedException

Creates and returns a copy of the buffer

collapseback to summary
public void collapse(int position, int length)

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.

Parameters
position:int

the position of the buffer where to add words

length:int

the number of words to add

ensureCapacityback to summary
public void ensureCapacity(int capacity)

Increases the size of the buffer if necessary

expandback to summary
public void expand(int position, int length)

Expands the buffer by adding the given number of words at the given position. The added words may contain stale data.

Parameters
position:int

the position of the buffer where to add words

length:int

the number of words to add

getLastWordback to summary
public long getLastWord()

Returns the last word of the buffer

Returns:long

the last word

getWordback to summary
public long getWord(int position)

Returns the word at a given position

Returns:long

the word

negateWordback to summary
public void negateWord(int position)

Negates the word at the given position in the buffer

negative_push_backback to summary
public void negative_push_back(Buffer buffer, int start, int number)

Same as push_back, but the words are negated.

Parameters
buffer:Buffer

the buffer

start:int

the position of the first word to add

number:int

the number of words to add

orLastWordback to summary
public void orLastWord(long mask)

Replaces the last word position in the buffer with its bitwise-or with the given mask.

orWordback to summary
public void orWord(int position, long mask)

Replaces the word at the given position in the buffer with its bitwise-or with the given mask.

push_backback to summary
public void push_back(long word)

Appends the specified word to the end of the buffer

push_backback to summary
public void push_back(Buffer buffer, int start, int number)

Appends the specified buffer words to the end of the buffer.

Parameters
buffer:Buffer

the buffer

start:int

the position of the first word to add

number:int

the number of words to add

removeLastWordback to summary
public void removeLastWord()

Removes the last word from the buffer

setLastWordback to summary
public void setLastWord(long word)

Replaces the last word in the buffer with the specified word.

setWordback to summary
public void setWord(int position, long word)

Replaces the word at the given position in the buffer with the specified word.

sizeInWordsback to summary
public int sizeInWords()

Returns the actual size in words

swapback to summary
public void swap(Buffer other)

Swap the content of the buffer with another.

Parameters
other:Buffer

buffer to swap with

trimback to summary
public void trim()

Reduces the internal buffer to its minimal allowable size. This can free memory.