galaxy.lang
Class Float32

java.lang.Object
  |
  +--galaxy.lang.GalaxyObject
        |
        +--galaxy.lang.Float32
All Implemented Interfaces:
ArrayObject, java.lang.Cloneable

public class Float32
extends GalaxyObject
implements ArrayObject

This class encapsulates an array of 32-bit floating point numbers.


Fields inherited from class galaxy.lang.GalaxyObject
GAL_BINARY, GAL_CLAUSE_FRAME, GAL_FLOAT, GAL_FLOAT_32, GAL_FLOAT_64, GAL_FRAME, GAL_FREE, GAL_INT, GAL_INT_16, GAL_INT_32, GAL_INT_64, GAL_KEYWORD, GAL_LIST, GAL_PRED_FRAME, GAL_PROXY, GAL_PTR, GAL_STRING, GAL_SYMBOL, GAL_TAG, GAL_TOKEN, GAL_TOPIC_FRAME, nameToType, type, typeToName
 
Constructor Summary
Float32()
          Creates an empty array of floats.
Float32(float[] floatArray)
          This constructor creates an object that encapsulates the reference to an array of floats.
Float32(float[] floatArray, boolean makeCopy)
          This constructor creates an object that encapsulates the reference to an array of floats.
 
Method Summary
 void append(float[] floatArray)
          Appends an array of floats to this object's array.
 void append(Float32 float32)
          Appends the array of the specified Float32 object to this object's array.
 byte[] getBytes()
          Returns this object's array as a byte array (in big endian byte order).
 float[] getFloatArray()
          Returns reference to this object's array of floats.
 int getSize()
          Returns the length of this object's array of floats.
 
Methods inherited from class galaxy.lang.GalaxyObject
getNameForObject, getType, getTypeForObject, getTypeName, isArrayType, nameType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Float32

public Float32()
Creates an empty array of floats.

Float32

public Float32(float[] floatArray)
This constructor creates an object that encapsulates the reference to an array of floats. If the array is null, an empty array is created.
Parameters:
floatArray - the array

Float32

public Float32(float[] floatArray,
               boolean makeCopy)
        throws java.lang.RuntimeException
This constructor creates an object that encapsulates the reference to an array of floats. If the array is null, an empty array is created.
Parameters:
floatArray - the array
makeCopy - if true, a copy of the array is stored. Otherwise, the reference to the array is stored.
Throws:
java.lang.RuntimeException - If there is an error while copying the array.
Method Detail

getSize

public int getSize()
Returns the length of this object's array of floats.
Specified by:
getSize in interface ArrayObject
Returns:
length of array

append

public void append(float[] floatArray)
            throws java.lang.RuntimeException
Appends an array of floats to this object's array.
Parameters:
floatArray - the array to append
Throws:
java.lang.RuntimeException - If there is an error while appending to the array.

append

public void append(Float32 float32)
            throws java.lang.RuntimeException
Appends the array of the specified Float32 object to this object's array.
Parameters:
float32 - the Float32 to append
Throws:
java.lang.RuntimeException - If there is an error while appending to the array.

getFloatArray

public float[] getFloatArray()
Returns reference to this object's array of floats.
Returns:
reference to the array

getBytes

public byte[] getBytes()
Returns this object's array as a byte array (in big endian byte order).
Specified by:
getBytes in interface ArrayObject
Returns:
the byte array