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.


Constructor Index

 o BooleanArray()
Construct myself to refer to an empty array.
 o BooleanArray(boolean[])
Construct myself to refer to a native Java array.
 o BooleanArray(BooleanArray)
Construct myself to refer to an existing BooleanArray.
 o BooleanArray(BooleanBuffer)
Construct myself to be a copy of an existing BooleanBuffer.

Method Index

 o at(int)
Return the integer at the specified index as a Boolean object.
 o begin()
Return an iterator positioned at my first item.
 o booleanAt(int)
Return the integer at the specified index as a Boolean object.
 o clone()
Return a shallow copy of myself.
 o elements()
Return an Enumeration of my components.
 o end()
Return an iterator positioned immediately after my last item.
 o equals(boolean[])
Return true if I contain the same items in the same order as a native array of booleans.
 o equals(BooleanArray)
Return true if I contain the same items in the same order as another BooleanArray.
 o equals(BooleanBuffer)
Return true if I contain the same items in the same order as another BooleanBuffer.
 o equals(Object)
Return true if I'm equal to a specified object.
 o finish()
Return an iterator positioned immediately after my last item.
 o get()
Retrieve the underlying primitive array.
 o maxSize()
Return the maximum number of objects that I can contain.
 o put(int, boolean)
Set the value of a specified index.
 o put(int, Object)
Set the object at a specified index.
 o size()
Return the number of objects that I contain.
 o start()
Return an iterator positioned at my first item.
 o toString()
Return a string that describes me.

Constructors

 o BooleanArray
 public BooleanArray()
Construct myself to refer to an empty array.

 o BooleanArray
 public BooleanArray(BooleanArray array)
Construct myself to refer to an existing BooleanArray.

Parameters:
array - The BooleanArray to copy.
 o BooleanArray
 public BooleanArray(BooleanBuffer buffer)
Construct myself to be a copy of an existing BooleanBuffer.

Parameters:
array - The BooleanBuffer to copy.
 o BooleanArray
 public BooleanArray(boolean array[])
Construct myself to refer to a native Java array.

Parameters:
array - The boolean[] to ape.

Methods

 o clone
 public synchronized Object clone()
Return a shallow copy of myself.

Overrides:
clone in class ArrayAdapter
 o toString
 public synchronized String toString()
Return a string that describes me.

Overrides:
toString in class Object
 o 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
 o 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.
 o 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.
 o 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.
 o get
 public boolean[] get()
Retrieve the underlying primitive array.

 o size
 public int size()
Return the number of objects that I contain.

Overrides:
size in class ArrayAdapter
 o maxSize
 public int maxSize()
Return the maximum number of objects that I can contain.

Overrides:
maxSize in class ArrayAdapter
 o elements
 public Enumeration elements()
Return an Enumeration of my components.

Overrides:
elements in class ArrayAdapter
 o start
 public ForwardIterator start()
Return an iterator positioned at my first item.

Overrides:
start in class ArrayAdapter
 o begin
 public synchronized BooleanIterator begin()
Return an iterator positioned at my first item.

 o finish
 public ForwardIterator finish()
Return an iterator positioned immediately after my last item.

Overrides:
finish in class ArrayAdapter
 o end
 public synchronized BooleanIterator end()
Return an iterator positioned immediately after my last item.

 o at
 public Object at(int index)
Return the integer at the specified index as a Boolean object.

Parameters:
index - The index.
Overrides:
at in class ArrayAdapter
 o booleanAt
 public synchronized boolean booleanAt(int index)
Return the integer at the specified index as a Boolean object.

Parameters:
index - The index.
 o 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.
Overrides:
put in class ArrayAdapter
 o 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