All Packages Class Hierarchy This Package Previous Next Index
Class COM.objectspace.jgl.adapters.ShortArray
java.lang.Object
|
+----COM.objectspace.jgl.adapters.ArrayAdapter
|
+----COM.objectspace.jgl.adapters.ShortArray
- public class ShortArray
- extends ArrayAdapter
ShortArray allows a native array of shorts to be accessed like a JGL
Container. It is particularly useful for applying generic algorithms
such as Sorting.sort() to a native array.
-
ShortArray()
- Construct myself to refer to an empty array.
-
ShortArray(short[])
- Construct myself to refer to a native Java array.
-
ShortArray(ShortArray)
- Construct myself to refer to an existing ShortArray.
-
ShortArray(ShortBuffer)
- Construct myself to be a copy of an existing ShortBuffer.
-
at(int)
- Return the integer at the specified index as a Short object.
-
begin()
- Return an iterator positioned at my first item.
-
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(Object)
- Return true if I'm equal to a specified object.
-
equals(short[])
- Return true if I contain the same items in the same order as
a native array of shorts.
-
equals(ShortArray)
- Return true if I contain the same items in the same order as
another ShortArray.
-
equals(ShortBuffer)
- Return true if I contain the same items in the same order as
another ShortBuffer.
-
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, Object)
- Set the object at a specified index.
-
put(int, short)
- Set the value of a specified index.
-
shortAt(int)
- Return the integer at the specified index as a Short object.
-
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.
ShortArray
public ShortArray()
- Construct myself to refer to an empty array.
ShortArray
public ShortArray(ShortArray array)
- Construct myself to refer to an existing ShortArray.
- Parameters:
- array - The ShortArray to copy.
ShortArray
public ShortArray(ShortBuffer buffer)
- Construct myself to be a copy of an existing ShortBuffer.
- Parameters:
- array - The ShortBuffer to copy.
ShortArray
public ShortArray(short array[])
- Construct myself to refer to a native Java array.
- Parameters:
- array - The short[] 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(ShortArray object)
- Return true if I contain the same items in the same order as
another ShortArray.
- Parameters:
- array - The ShortArray to compare myself against.
- Returns:
- true if I'm equal to the specified object.
equals
public boolean equals(ShortBuffer buffer)
- Return true if I contain the same items in the same order as
another ShortBuffer.
- Parameters:
- buffer - The ShortBuffer to compare myself against.
equals
public synchronized boolean equals(short array[])
- Return true if I contain the same items in the same order as
a native array of shorts.
- Parameters:
- array - The array to compare myself against.
get
public short[] get()
- Retrieve the underlying primitive array.
size
public int size()
- Return the number of objects that I contain.
- Overrides:
- size in class ArrayAdapter
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.
- Overrides:
- elements in class ArrayAdapter
start
public ForwardIterator start()
- Return an iterator positioned at my first item.
- Overrides:
- start in class ArrayAdapter
begin
public synchronized ShortIterator begin()
- Return an iterator positioned at my first item.
finish
public ForwardIterator finish()
- Return an iterator positioned immediately after my last item.
- Overrides:
- finish in class ArrayAdapter
end
public synchronized ShortIterator 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 Short object.
- Parameters:
- index - The index.
- Overrides:
- at in class ArrayAdapter
shortAt
public synchronized short shortAt(int index)
- Return the integer at the specified index as a Short 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 Number
- Parameters:
- index - The index.
- object - The object to place at the specified index.
- Throws: ClassCastException
- if object is not a Number
- Throws: IndexOutOfBoundsException
- if index is invalid.
- Overrides:
- put in class ArrayAdapter
put
public synchronized void put(int index,
short object)
- Set the value of a specified index.
- Parameters:
- index - The index.
- object - The short to place at the specified index.
- Throws: IndexOutOfBoundsException
- if index is invalid.
All Packages Class Hierarchy This Package Previous Next Index