All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.objectspace.jgl.adapters.IntIterator

java.lang.Object
   |
   +----COM.objectspace.jgl.adapters.IntIterator

public final class IntIterator
extends Object
implements RandomAccessIterator, Serializable
A IntIterator is a random access iterator that allows you to iterate through the contents of a IntBuffer.

See Also:
RandomAccessIterator

Constructor Index

 o IntIterator()
Construct myself to be an iterator with no associated data structure or position.
 o IntIterator(int[], int)
Construct myself to be positioned at a particular index of a specific array of ints.
 o IntIterator(IntArray, int)
Construct myself to be positioned at a particular index of a specific IntArray.
 o IntIterator(IntBuffer, int)
Construct myself to be positioned at a particular index of a specific IntBuffer.
 o IntIterator(IntIterator)
Construct myself to be a copy of an existing iterator.

Method Index

 o advance()
Advance by one.
 o advance(int)
Advance by a specified amount.
 o atBegin()
Return true if I'm positioned at the first item of my input stream.
 o atEnd()
Return true if I'm positioned after the last item in my input stream.
 o begin(int[])
Return an iterator positioned at the first element of a particular array.
 o clone()
Return a clone of myself.
 o distance(ForwardIterator)
Return the distance from myself to another iterator.
 o end(int[])
Return an iterator positioned immediately after the last element of a particular array.
 o equals(IntIterator)
Return true if iterator is positioned at the same element as me.
 o equals(Object)
Return true if a specified object is the same kind of iterator as me and is positioned at the same element.
 o get()
Return the object at my current position.
 o get(int)
Return the object that is a specified distance from my current position.
 o getContainer()
Return my associated array.
 o getInt()
 o getInt(int)
 o hasMoreElements()
Return true if there are more elements in my input stream.
 o index()
Return my current index.
 o isCompatibleWith(InputIterator)
Return true if both iterator and myself can be used as a range.
 o less(RandomAccessIterator)
Return true if I'm before a specified iterator.
 o nextElement()
Return the next element in my input stream.
 o put(int)
 o put(int, int)
 o put(int, Object)
Write an object at a specified distance from my current position.
 o put(Object)
Set the object at my current position to a specified value.
 o retreat()
Retreat by one.
 o retreat(int)
Retreat by a specified amount.

Constructors

 o IntIterator
 public IntIterator()
Construct myself to be an iterator with no associated data structure or position.

 o IntIterator
 public IntIterator(IntIterator iterator)
Construct myself to be a copy of an existing iterator.

Parameters:
iterator - The iterator to copy.
 o IntIterator
 public IntIterator(int vector[],
                    int index)
Construct myself to be positioned at a particular index of a specific array of ints.

Parameters:
vector - My associated int[].
index - My associated index.
 o IntIterator
 public IntIterator(IntArray vector,
                    int index)
Construct myself to be positioned at a particular index of a specific IntArray.

Parameters:
vector - My associated IntArray.
index - My associated index.
 o IntIterator
 public IntIterator(IntBuffer vector,
                    int index)
Construct myself to be positioned at a particular index of a specific IntBuffer.

Parameters:
vector - My associated IntBuffer.
index - My associated index.

Methods

 o begin
 public static IntIterator begin(int array[])
Return an iterator positioned at the first element of a particular array.

Parameters:
array - The array whose first element I will be positioned at.
 o end
 public static IntIterator end(int array[])
Return an iterator positioned immediately after the last element of a particular array.

Parameters:
array - The array whose last element I will be positioned after.
 o clone
 public Object clone()
Return a clone of myself.

Overrides:
clone in class Object
 o equals
 public boolean equals(Object object)
Return true if a specified object is the same kind of iterator as me and is positioned at the same element.

Parameters:
object - Any object.
Overrides:
equals in class Object
 o equals
 public boolean equals(IntIterator iterator)
Return true if iterator is positioned at the same element as me.

Parameters:
iterator - The iterator to compare myself against.
 o less
 public boolean less(RandomAccessIterator iterator)
Return true if I'm before a specified iterator.

Parameters:
iterator - The iterator to compare myself against.
 o atBegin
 public boolean atBegin()
Return true if I'm positioned at the first item of my input stream.

 o atEnd
 public boolean atEnd()
Return true if I'm positioned after the last item in my input stream.

 o hasMoreElements
 public boolean hasMoreElements()
Return true if there are more elements in my input stream.

 o advance
 public void advance()
Advance by one.

 o advance
 public void advance(int n)
Advance by a specified amount.

Parameters:
n - The amount to advance.
 o retreat
 public void retreat()
Retreat by one.

 o retreat
 public void retreat(int n)
Retreat by a specified amount.

Parameters:
n - The amount to retreat.
 o nextElement
 public Object nextElement()
Return the next element in my input stream.

Throws: NoSuchElementException
If I'm positioned at an invalid index.
 o get
 public Object get()
Return the object at my current position.

Throws: ArrayIndexOutOfBoundsException
If I'm positioned at an invalid index.
 o getInt
 public int getInt()
 o get
 public Object get(int offset)
Return the object that is a specified distance from my current position.

Parameters:
offset - The offset from my current position.
Throws: ArrayIndexOutOfBoundsException
If the adjusted index is invalid.
 o getInt
 public int getInt(int offset)
 o put
 public void put(Object object)
Set the object at my current position to a specified value.

Parameters:
object - The object to be written at my current position.
Throws: ArrayIndexOutOfBoundsException
If I'm positioned at an invalid index.
 o put
 public void put(int object)
 o put
 public void put(int offset,
                 Object object)
Write an object at a specified distance from my current position.

Parameters:
offset - The offset from my current position.
object - The object to write.
Throws: ArrayIndexOutOfBoundsException
If the adjusted index is invalid.
 o put
 public void put(int offset,
                 int object)
 o distance
 public int distance(ForwardIterator iterator)
Return the distance from myself to another iterator. I should be before the specified iterator.

Parameters:
iterator - The iterator to compare myself against.
Throws: IllegalArgumentException
If the iterators are incompatible.
 o index
 public int index()
Return my current index.

 o getContainer
 public Container getContainer()
Return my associated array.

 o isCompatibleWith
 public boolean isCompatibleWith(InputIterator iterator)
Return true if both iterator and myself can be used as a range.


All Packages  Class Hierarchy  This Package  Previous  Next  Index