| JGL - The Generic Collection Library for Java |
All Packages Class Hierarchy This Package Previous Next Index
Class com.objectspace.jgl.adapters.FloatArray
java.lang.Object
|
+----com.objectspace.jgl.adapters.ArrayAdapter
|
+----com.objectspace.jgl.adapters.FloatArray
- public class FloatArray
- extends ArrayAdapter
FloatArray allows a native array of floats to be accessed like a JGL
Container. It is particularly useful for applying generic algorithms
such as Sorting.sort() to a native array.
-
FloatArray()
- Construct myself to refer to an empty array.
-
FloatArray(float[])
- Construct myself to refer to a native Java array.
-
FloatArray(FloatArray)
- Construct myself to refer to an existing FloatArray.
-
FloatArray(FloatBuffer)
- Construct myself to be a copy of an existing FloatBuffer.
-
at(int)
- Return the integer at the specified index as a Float 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(float[])
- Return true if I contain the same items in the same order as
a native array of floats.
-
equals(FloatArray)
- Return true if I contain the same items in the same order as
another FloatArray.
-
equals(FloatBuffer)
- Return true if I contain the same items in the same order as
another FloatBuffer.
-
equals(Object)
- Return true if I'm equal to a specified object.
-
finish()
- Return an iterator positioned immediately after my last item.
-
floatAt(int)
- Return the integer at the specified index as a Float object.
-
get()
- Retrieve the underlying primitive array.
-
maxSize()
- Return the maximum number of objects that I can contain.
-
put(int, float)
- 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.
FloatArray
public FloatArray()
- Construct myself to refer to an empty array.
FloatArray
public FloatArray(FloatArray array)
- Construct myself to refer to an existing FloatArray.
- Parameters:
- array - The FloatArray to copy.
FloatArray
public FloatArray(FloatBuffer buffer)
- Construct myself to be a copy of an existing FloatBuffer.
- Parameters:
- array - The FloatBuffer to copy.
FloatArray
public FloatArray(float array[])
- Construct myself to refer to a native Java array.
- Parameters:
- array - The float[] 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(FloatArray object)
- Return true if I contain the same items in the same order as
another FloatArray.
- Parameters:
- array - The FloatArray to compare myself against.
- Returns:
- true if I'm equal to the specified object.
equals
public boolean equals(FloatBuffer buffer)
- Return true if I contain the same items in the same order as
another FloatBuffer.
- Parameters:
- buffer - The FloatBuffer to compare myself against.
equals
public synchronized boolean equals(float array[])
- Return true if I contain the same items in the same order as
a native array of floats.
- Parameters:
- array - The array to compare myself against.
get
public float[] 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 FloatIterator 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 FloatIterator 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 Float object.
- Parameters:
- index - The index.
floatAt
public synchronized float floatAt(int index)
- Return the integer at the specified index as a Float 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.
put
public synchronized void put(int index,
float object)
- Set the value of a specified index.
- Parameters:
- index - The index.
- object - The float to place at the specified index.
- Throws: IndexOutOfBoundsException
- if index is invalid.
All Packages Class Hierarchy This Package Previous Next Index