| JGL - The Generic Collection Library for Java |
All Packages Class Hierarchy This Package Previous Next Index
Class com.objectspace.jgl.adapters.BooleanArray
java.lang.Object
|
+----com.objectspace.jgl.adapters.ArrayAdapter
|
+----com.objectspace.jgl.adapters.BooleanArray
- public class BooleanArray
- extends ArrayAdapter
BooleanArray allows a native array of booleans to be accessed like a JGL
Container. It is particularly useful for applying generic algorithms
such as Sorting.sort() to a native array.
-
BooleanArray()
- Construct myself to refer to an empty array.
-
BooleanArray(boolean[])
- Construct myself to refer to a native Java array.
-
BooleanArray(BooleanArray)
- Construct myself to refer to an existing BooleanArray.
-
BooleanArray(BooleanBuffer)
- Construct myself to be a copy of an existing BooleanBuffer.
-
at(int)
- Return the integer at the specified index as a Boolean object.
-
begin()
- Return an iterator positioned at my first item.
-
booleanAt(int)
- Return the integer at the specified index as a Boolean object.
-
clone()
- Return a shallow copy of myself.
-
elements()
- Return an Enumeration of my components.
-
end()
- Return an iterator positioned immediately after my last item.
-
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
another 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 a specified object.
-
finish()
- Return an iterator positioned immediately after my last item.
-
get()
- Retrieve the underlying primitive array.
-
maxSize()
- Return the maximum number of objects that I can contain.
-
put(int, boolean)
- Set the value of a specified index.
-
put(int, Object)
- Set the object at a specified index.
-
size()
- Return the number of objects that I contain.
-
start()
- Return an iterator positioned at my first item.
-
toString()
- Return a string that describes me.
BooleanArray
public BooleanArray()
- Construct myself to refer to an empty array.
BooleanArray
public BooleanArray(BooleanArray array)
- Construct myself to refer to an existing BooleanArray.
- Parameters:
- array - The BooleanArray to copy.
BooleanArray
public BooleanArray(BooleanBuffer buffer)
- Construct myself to be a copy of an existing BooleanBuffer.
- Parameters:
- array - The BooleanBuffer to copy.
BooleanArray
public BooleanArray(boolean array[])
- Construct myself to refer to a native Java array.
- Parameters:
- array - The boolean[] to ape.
clone
public synchronized Object clone()
- Return a shallow copy of myself.
- Overrides:
- clone in class ArrayAdapter
toString
public synchronized String toString()
- Return a string that describes me.
- Overrides:
- toString in class Object
equals
public boolean equals(Object object)
- Return true if I'm equal to a specified object.
- Parameters:
- object - The object to compare myself against.
- Returns:
- true if I'm equal to the specified object.
- Overrides:
- equals in class ArrayAdapter
equals
public boolean equals(BooleanArray object)
- Return true if I contain the same items in the same order as
another BooleanArray.
- Parameters:
- array - The BooleanArray to compare myself against.
- Returns:
- true if I'm equal to the specified object.
equals
public boolean equals(BooleanBuffer buffer)
- Return true if I contain the same items in the same order as
another BooleanBuffer.
- Parameters:
- buffer - The BooleanBuffer to compare myself against.
equals
public synchronized 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.
get
public boolean[] get()
- Retrieve the underlying primitive array.
size
public int size()
- Return the number of objects that I contain.
maxSize
public int maxSize()
- Return the maximum number of objects that I can contain.
- Overrides:
- maxSize in class ArrayAdapter
elements
public Enumeration elements()
- Return an Enumeration of my components.
start
public ForwardIterator start()
- Return an iterator positioned at my first item.
begin
public synchronized BooleanIterator begin()
- Return an iterator positioned at my first item.
finish
public ForwardIterator finish()
- Return an iterator positioned immediately after my last item.
end
public synchronized BooleanIterator end()
- Return an iterator positioned immediately after my last item.
at
public Object at(int index)
- Return the integer at the specified index as a Boolean object.
- Parameters:
- index - The index.
booleanAt
public synchronized boolean booleanAt(int index)
- Return the integer at the specified index as a Boolean object.
- Parameters:
- index - The index.
put
public void put(int index,
Object object)
- Set the object at a specified index. The object must be a Boolean
- Parameters:
- index - The index.
- object - The object to place at the specified index.
- Throws: ClassCastException
- if object is not a Boolean
- Throws: IndexOutOfBoundsException
- if index is invalid.
put
public synchronized void put(int index,
boolean object)
- Set the value of a specified index.
- Parameters:
- index - The index.
- object - The boolean to place at the specified index.
- Throws: IndexOutOfBoundsException
- if index is invalid.
All Packages Class Hierarchy This Package Previous Next Index