All Packages Class Hierarchy This Package Previous Next Index
Class COM.objectspace.jgl.adapters.BooleanBuffer
java.lang.Object
|
+----COM.objectspace.jgl.adapters.ArrayAdapter
|
+----COM.objectspace.jgl.adapters.BooleanBuffer
- public class BooleanBuffer
- extends ArrayAdapter
A BooleanBuffer is a sequence that is very similar to a regular
BooleanArray, except that it can expand to accomodate new elements.
The implementation store elements in a contiguous linear memory space
so that index-based access is very quick. When an BooleanBuffer's originally
allocated memory space is exceeded, its elements are copied into a new
memory space that is large enough to accomodate everything.
If an insertion causes reallocation, all iterators and references are
invalidated; otherwise, only the iterators and references after the
insertion point are invalidated.
A remove invalidates all of the iterators and references after the point
of the remove.
- See Also:
- BooleanArray, BooleanIterator
-
BooleanBuffer()
- Construct myself to be an empty BooleanBuffer.
-
BooleanBuffer(BitSet)
- Construct myself to be a copy of an existing BitSet.
-
BooleanBuffer(boolean[])
- Construct myself to use a specified array as my initial storage.
-
BooleanBuffer(BooleanArray)
- Construct myself to be a copy of an existing BooleanArray.
-
BooleanBuffer(BooleanBuffer)
- Construct myself to be a copy of an existing BooleanBuffer.
-
BooleanBuffer(int)
- Construct myself to contain a specified number of null elements.
-
BooleanBuffer(int, boolean)
- Construct myself to contain a specified number of elements set to
a particular object.
-
add(boolean)
- Add a boolean after my last element.
-
add(Object)
- Add an object after my last element.
-
at(int)
- Return the element at the specified index.
-
begin()
- Return an iterator positioned at my first item.
-
booleanAt(int)
- Return the boolean at the specified index.
-
capacity()
- Return the number of elements that I contain without allocating more
internal storage.
-
clear()
- Remove all of my elements.
-
clone()
- Return a shallow copy of myself.
-
contains(boolean)
- Return true if I contain a particular boolean.
-
copy(BooleanBuffer)
- Become a copy of an existing BooleanBuffer.
-
copyTo(BitSet)
- Copy all my elements into the specified BitSet, expanding the
BitSet if necessary.
-
copyTo(boolean[])
- Copy my elements into the specified array.
-
count(boolean)
- Return the number of objects that equal a particular value.
-
count(int, int, boolean)
- Return the number of objects within a particular range of indices
that match a particular boolean.
-
count(int, int, Object)
- Return the number of objects within a particular range of indices
that match a particular value.
-
count(Object)
- Return the number of objects that match a particular value.
-
elements()
- Return an Enumeration of my components.
-
end()
- Return an iterator positioned immediately after my last item.
-
ensureCapacity(int)
- Pre-allocate enough space to hold a specified number of elements.
-
equals(boolean[])
- Return true if I contain the same items in the same order as
a native array of booleans.
-
equals(BooleanArray)
- Return true if I contain the same items in the same order as
a BooleanArray.
-
equals(BooleanBuffer)
- Return true if I contain the same items in the same order as
another BooleanBuffer.
-
equals(Object)
- Return true if I'm equal to another object.
-
finish()
- Return an iterator positioned immediately after my last item.
-
get()
- Retrieve the underlying primitive array.
-
hashCode()
- Return my hash code for support of hashing containers
-
indexOf(boolean)
- Return the index of the first boolean that matches a particular value,
or -1 if the value is not found.
-
indexOf(int, int, boolean)
- Return the index of the first boolean within a range of indices that
match a particular value, or -1 if the boolean is not found.
-
indexOf(int, int, Object)
- Return the index of the first object within a range of indices that
match a particular object, or -1 if the object is not found.
-
insert(BooleanIterator, boolean)
- Insert a value at a particular position and return an iterator
positioned at the new element.
-
insert(BooleanIterator, ForwardIterator, ForwardIterator)
- Insert a sequence of objects at a particular location.
-
insert(BooleanIterator, int, boolean)
- Insert multiple values at a particular position.
-
insert(BooleanIterator, int, Object)
- Insert multiple objects at a particular position.
-
insert(BooleanIterator, Object)
- Insert an object at a particular position and return an iterator
positioned at the new element.
-
insert(int, boolean)
- Insert a value at a particular index.
-
insert(int, ForwardIterator, ForwardIterator)
- Insert a sequence of objects at a particular index.
-
insert(int, int, boolean)
- Insert multiple objects at a particular index.
-
insert(int, int, Object)
- Insert multiple objects at a particular index.
-
insert(int, Object)
- Insert an object at a particular index.
-
popBack()
- Remove and return my last element.
-
popFront()
- Remove and return my first element.
-
pushBack(boolean)
- Add a boolean after my last element.
-
pushBack(Object)
- Add an object after my last element.
-
pushFront(boolean)
- Insert a value in front of my first element.
-
pushFront(Object)
- Insert an object in front of my first element.
-
put(int, boolean)
- Set the boolean at the specified index to a particular value.
-
put(int, Object)
- Set the element at the specified index to a particular object.
-
remove(Enumeration)
- Remove the element at a particular position.
-
remove(Enumeration, Enumeration)
- Remove the elements in the specified range.
-
remove(int)
- Remove the element at a particular index.
-
remove(int, int)
- Remove the elements within a range of indices.
-
remove(int, int, Object)
- Remove all elements within a range of indices that match a particular object
and return the number of objects that were removed.
-
remove(Object)
- Remove all elements that match a particular object and return the number of
objects that were removed.
-
remove(Object, int)
- Remove at most a given number of elements that match a particular
object and return the number of
objects that were removed.
-
replace(boolean, boolean)
-
-
replace(int, int, boolean, boolean)
-
-
replace(int, int, Object, Object)
- Replace all elements within a range of indices that match a particular object
with a new value and return the number of objects that were replaced.
-
replace(Object, Object)
- Replace all elements that match a particular object with a new value and return
the number of objects that were replaced.
-
setSize(int)
- Sets the size of the BooleanBuffer.
-
size()
- Return the number of entries that I contain.
-
start()
- Return an iterator positioned at my first item.
-
swap(BooleanBuffer)
- Swap my contents with another BooleanBuffer.
-
toString()
- Return a string that describes me.
-
trimToSize()
- If my storage space is currently larger than my total number of elements,
reallocate the elements into a storage space that is exactly the right size.
BooleanBuffer
public BooleanBuffer()
- Construct myself to be an empty BooleanBuffer.
BooleanBuffer
public BooleanBuffer(int size)
- Construct myself to contain a specified number of null elements.
- Parameters:
- size - The number of elements to contain.
- Throws: IllegalArgumentException
- If size is negative.
BooleanBuffer
public BooleanBuffer(int size,
boolean object)
- Construct myself to contain a specified number of elements set to
a particular object.
- Parameters:
- size - The number of elements to contain.
- object - The initial value of each element.
- Throws: IllegalArgumentException
- If size is negative.
BooleanBuffer
public BooleanBuffer(boolean array[])
- Construct myself to use a specified array as my initial storage.
- Parameters:
- The - array to use as initial storage.
BooleanBuffer
public BooleanBuffer(BooleanBuffer array)
- Construct myself to be a copy of an existing BooleanBuffer.
- Parameters:
- array - The BooleanBuffer to copy.
BooleanBuffer
public BooleanBuffer(BooleanArray array)
- Construct myself to be a copy of an existing BooleanArray.
- Parameters:
- array - The BooleanArray to copy.
BooleanBuffer
public BooleanBuffer(BitSet bitset)
- Construct myself to be a copy of an existing BitSet.
- Parameters:
- array - The BitSet to copy.
- See Also:
- BitSet
clone
public synchronized Object clone()
- Return a shallow copy of myself.
- Overrides:
- clone in class ArrayAdapter
hashCode
public synchronized int hashCode()
- Return my hash code for support of hashing containers
- Overrides:
- hashCode in class ArrayAdapter
equals
public boolean equals(Object object)
- Return true if I'm equal to another object.
- Parameters:
- object - The object to compare myself against.
- Overrides:
- equals in class ArrayAdapter
equals
public boolean equals(BooleanBuffer array)
- Return true if I contain the same items in the same order as
another BooleanBuffer.
- Parameters:
- array - The BooleanBuffer to compare myself against.
equals
public boolean equals(BooleanArray array)
- Return true if I contain the same items in the same order as
a BooleanArray.
- Parameters:
- array - The BooleanArray to compare myself against.
equals
public boolean equals(boolean array[])
- Return true if I contain the same items in the same order as
a native array of booleans.
- Parameters:
- array - The array to compare myself against.
toString
public synchronized String toString()
- Return a string that describes me.
- Overrides:
- toString in class Object
copy
public synchronized void copy(BooleanBuffer array)
- Become a copy of an existing BooleanBuffer.
- Parameters:
- array - The BooleanBuffer that I shall become a copy of.
copyTo
public synchronized void copyTo(boolean array[])
- Copy my elements into the specified array.
The number of items that are copied is equal to the smaller of my
length and the size of the specified array.
- Parameters:
- array - The array that I shall copy my elements into.
copyTo
public synchronized void copyTo(BitSet bitset)
- Copy all my elements into the specified BitSet, expanding the
BitSet if necessary.
- Parameters:
- bitset - The bitset that I shall copy my elements into.
- See Also:
- BitSet
get
public synchronized boolean[] get()
- Retrieve the underlying primitive array.
size
public int size()
- Return the number of entries that I contain.
- Overrides:
- size in class ArrayAdapter
capacity
public int capacity()
- Return the number of elements that I contain without allocating more
internal storage.
at
public synchronized Object at(int index)
- Return the element at the specified index.
- Parameters:
- index - The index.
- Throws: IndexOutOfBoundsException
- If the index is invalid.
- Overrides:
- at in class ArrayAdapter
booleanAt
public boolean booleanAt(int index)
- Return the boolean at the specified index.
- Parameters:
- index - The index.
- Throws: IndexOutOfBoundsException
- If the index is invalid.
put
public void put(int index,
Object object)
- Set the element at the specified index to a particular object.
- Parameters:
- index - The index.
- object - The object.
- Throws: IndexOutOfBoundsException
- If the index is invalid.
- Overrides:
- put in class ArrayAdapter
put
public synchronized void put(int index,
boolean object)
- Set the boolean at the specified index to a particular value.
- Parameters:
- index - The index.
- object - The value.
- Throws: IndexOutOfBoundsException
- If the index is invalid.
clear
public synchronized void clear()
- Remove all of my elements.
- Overrides:
- clear in class ArrayAdapter
remove
public Object remove(Enumeration pos)
- Remove the element at a particular position.
- Parameters:
- pos - An enumeration positioned at the element to remove.
- Throws: IllegalArgumentException
- is the Enumeration isn't an
BooleanIterator for this BooleanBuffer object.
- Overrides:
- remove in class ArrayAdapter
remove
public synchronized Object remove(int index)
- Remove the element at a particular index.
- Parameters:
- index - The index of the element to remove.
- Returns:
- The object removed.
- Throws: IndexOutOfBoundsException
- If the index is invalid.
remove
public int remove(Enumeration first,
Enumeration last)
- Remove the elements in the specified range.
- Parameters:
- first - An Enumeration positioned at the first element to remove.
- last - An Enumeration positioned immediately after the last element to remove.
- Returns:
- The number of elements removed.
- Throws: IllegalArgumentException
- is the Enumeration isn't an
BooleanIterator for this BooleanBuffer object.
- Overrides:
- remove in class ArrayAdapter
remove
public synchronized int remove(int first,
int last)
- Remove the elements within a range of indices.
- Parameters:
- first - The index of the first element to remove.
- last - The index of the last element to remove.
- Returns:
- The number of elements removed.
- Throws: IndexOutOfBoundsException
- If either index is invalid.
popBack
public synchronized Object popBack()
- Remove and return my last element.
- Throws: InvalidOperationException
- If the BooleanBuffer is empty.
- Overrides:
- popBack in class ArrayAdapter
add
public Object add(Object object)
- Add an object after my last element. Returns null.
This function is a synonym for pushBack().
- Parameters:
- object - The object to add.
- Overrides:
- add in class ArrayAdapter
add
public synchronized void add(boolean b)
- Add a boolean after my last element. Returns null.
This function is a synonym for pushBack().
- Parameters:
- b - The value to add.
pushBack
public void pushBack(Object object)
- Add an object after my last element.
- Parameters:
- The - object to add.
- Overrides:
- pushBack in class ArrayAdapter
pushBack
public void pushBack(boolean object)
- Add a boolean after my last element.
- Parameters:
- The - object to add.
insert
public BooleanIterator insert(BooleanIterator pos,
Object object)
- Insert an object at a particular position and return an iterator
positioned at the new element.
- Parameters:
- pos - An iterator positioned at the element that the object will be inserted immediately before.
- object - The object to insert.
insert
public BooleanIterator insert(BooleanIterator pos,
boolean object)
- Insert a value at a particular position and return an iterator
positioned at the new element.
- Parameters:
- pos - An iterator positioned at the element that the object will be inserted immediately before.
- object - The object to insert.
insert
public void insert(int index,
Object object)
- Insert an object at a particular index.
- Parameters:
- index - The index of the element that the object will be inserted immediately before.
- object - The object to insert.
- Throws: IndexOutOfBoundsException
- If the index is invalid.
insert
public synchronized void insert(int index,
boolean object)
- Insert a value at a particular index.
- Parameters:
- index - The index of the element that the object will be inserted immediately before.
- object - The value to insert.
- Throws: IndexOutOfBoundsException
- If the index is invalid.
insert
public void insert(BooleanIterator pos,
int n,
Object object)
- Insert multiple objects at a particular position.
- Parameters:
- pos - An iterator positioned at the element before which the
elements will be inserted.
- n - The number of objects to insert.
- object - The object to insert.
insert
public void insert(BooleanIterator pos,
int n,
boolean object)
- Insert multiple values at a particular position.
- Parameters:
- pos - An iterator positioned at the element before which the
elements will be inserted.
- n - The number of values to insert.
- object - The value to insert.
insert
public void insert(int index,
int n,
Object object)
- Insert multiple objects at a particular index.
- Parameters:
- index - The index of the element immediately before the values will
be inserted.
- object - The object to insert.
- Throws: IndexOutOfBoundsException
- If the index is invalid.
- Throws: IllegalArgumentException
- If the number of values
is negative.
insert
public synchronized void insert(int index,
int n,
boolean object)
- Insert multiple objects at a particular index.
- Parameters:
- index - The index of the element immediately before the values will
be inserted.
- object - The value to insert.
- Throws: IndexOutOfBoundsException
- If the index is invalid.
- Throws: IllegalArgumentException
- If the number of values
is negative.
insert
public void insert(BooleanIterator pos,
ForwardIterator first,
ForwardIterator last)
- Insert a sequence of objects at a particular location.
- Parameters:
- pos - The location of the element that the objects will be inserted immediately before.
- first - An iterator positioned at the first element to insert.
- last - An iterator positioned immediately after the last element to insert.
insert
public synchronized void insert(int index,
ForwardIterator first,
ForwardIterator last)
- Insert a sequence of objects at a particular index.
- Parameters:
- index - The index of the element that the objects will be inserted immediately before.
- first - An iterator positioned at the first element to insert.
- last - An iterator positioned immediately after the last element to insert.
swap
public synchronized void swap(BooleanBuffer array)
- Swap my contents with another BooleanBuffer.
- Parameters:
- array - The BooleanBuffer that I will swap my contents with.
elements
public synchronized Enumeration elements()
- Return an Enumeration of my components.
- Overrides:
- elements in class ArrayAdapter
start
public ForwardIterator start()
- Return an iterator positioned at my first item.
- Overrides:
- start in class ArrayAdapter
finish
public ForwardIterator finish()
- Return an iterator positioned immediately after my last item.
- Overrides:
- finish in class ArrayAdapter
begin
public synchronized BooleanIterator begin()
- Return an iterator positioned at my first item.
end
public synchronized BooleanIterator end()
- Return an iterator positioned immediately after my last item.
trimToSize
public synchronized void trimToSize()
- If my storage space is currently larger than my total number of elements,
reallocate the elements into a storage space that is exactly the right size.
ensureCapacity
public synchronized void ensureCapacity(int n)
- Pre-allocate enough space to hold a specified number of elements.
This operation does not change the value returned by size().
- Parameters:
- n - The amount of space to pre-allocate.
- Throws: IllegalArgumentException
- If the specified size is negative.
popFront
public synchronized Object popFront()
- Remove and return my first element.
- Throws: InvalidOperationException
- If the BooleanBuffer is empty.
- Overrides:
- popFront in class ArrayAdapter
pushFront
public void pushFront(Object object)
- Insert an object in front of my first element.
- Parameters:
- object - The object to insert.
- Overrides:
- pushFront in class ArrayAdapter
pushFront
public void pushFront(boolean object)
- Insert a value in front of my first element.
- Parameters:
- object - The object to insert.
remove
public int remove(Object object)
- Remove all elements that match a particular object and return the number of
objects that were removed.
- Parameters:
- object - The object to remove.
- Overrides:
- remove in class ArrayAdapter
remove
public synchronized int remove(Object object,
int count)
- Remove at most a given number of elements that match a particular
object and return the number of
objects that were removed.
- Parameters:
- object - The object to remove.
- count - The maximum number of objects to remove.
- Overrides:
- remove in class ArrayAdapter
remove
public synchronized int remove(int first,
int last,
Object object)
- Remove all elements within a range of indices that match a particular object
and return the number of objects that were removed.
- Parameters:
- first - The index of the first object to consider.
- last - The index of the last object to consider.
- object - The object to remove.
- Throws: IndexOutOfBoundsException
- If either index is invalid.
- Overrides:
- remove in class ArrayAdapter
replace
public int replace(Object oldValue,
Object newValue)
- Replace all elements that match a particular object with a new value and return
the number of objects that were replaced.
- Parameters:
- oldValue - The object to be replaced.
- newValue - The value to substitute.
- Overrides:
- replace in class ArrayAdapter
replace
public int replace(boolean oldValue,
boolean newValue)
replace
public int replace(int first,
int last,
Object oldValue,
Object newValue)
- Replace all elements within a range of indices that match a particular object
with a new value and return the number of objects that were replaced.
- Parameters:
- first - The index of the first object to be considered.
- last - The index of the last object to be considered.
- oldValue - The object to be replaced.
- newValue - The value to substitute.
- Throws: IndexOutOfBoundsException
- If either index is invalid.
- Overrides:
- replace in class ArrayAdapter
replace
public synchronized int replace(int first,
int last,
boolean oldValue,
boolean newValue)
count
public int count(Object object)
- Return the number of objects that match a particular value.
- Parameters:
- object - The object to count.
- Overrides:
- count in class ArrayAdapter
count
public int count(boolean object)
- Return the number of objects that equal a particular value.
- Parameters:
- object - The boolean to count.
count
public synchronized int count(int first,
int last,
Object object)
- Return the number of objects within a particular range of indices
that match a particular value.
- Parameters:
- first - The index of the first object to consider.
- last - The index of the last object to consider.
- Throws: IndexOutOfBoundsException
- If either index is
invalid.
- Overrides:
- count in class ArrayAdapter
count
public int count(int first,
int last,
boolean object)
- Return the number of objects within a particular range of indices
that match a particular boolean.
- Parameters:
- first - The index of the first object to consider.
- last - The index of the last object to consider.
- Throws: IndexOutOfBoundsException
- If either index is
invalid.
indexOf
public int indexOf(boolean object)
- Return the index of the first boolean that matches a particular value,
or -1 if the value is not found.
- Parameters:
- object - The boolean to find.
indexOf
public int indexOf(int first,
int last,
Object object)
- Return the index of the first object within a range of indices that
match a particular object, or -1 if the object is not found.
- Parameters:
- first - The index of the first object to consider.
- last - The index of the last object to consider.
- object - The object to find.
- Throws: IndexOutOfBoundsException
- If either index is
invalid.
- Overrides:
- indexOf in class ArrayAdapter
indexOf
public synchronized int indexOf(int first,
int last,
boolean object)
- Return the index of the first boolean within a range of indices that
match a particular value, or -1 if the boolean is not found.
- Parameters:
- first - The index of the first value to consider.
- last - The index of the last value to consider.
- object - The value to find.
- Throws: IndexOutOfBoundsException
- If either index is
invalid.
setSize
public synchronized void setSize(int newSize)
- Sets the size of the BooleanBuffer. if the size shrinks, the extra elements (at
the end of the array) are lost; if the size increases, the new elements
are set to null.
- Parameters:
- newSize - The new size of the BooleanBuffer.
contains
public boolean contains(boolean object)
- Return true if I contain a particular boolean.
- Parameters:
- object - The boolean for which ot search.
All Packages Class Hierarchy This Package Previous Next Index