galaxy.lang
Class Float32

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

public class Float32
extends BinaryObject

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


Fields inherited from class galaxy.lang.BinaryObject
data
 
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(byte[] data)
          Deprecated. As of Galaxy Communicator 3.0. Use Float32(), Float32(float[]) and Float32(float[], boolean) constructors.
Float32(float[] floatArray)
          This constructor creates an object that encapsulates a reference to the specified array.
Float32(float[] floatArray, boolean makeCopy)
          This constructor creates an object that encapsulates the specified array.
 
Method Summary
 void append(float[] floatArray)
          Appends an array of floats to this array object.
 byte[] getBytes()
          Returns this array as a byte array (in big endian byte order).
 float[] getFloatArray()
           
 int getSize()
          Returns the length of this object's float array.
 float[] toFloatArray()
          Deprecated. As of Galaxy Communicator 3.0. Use getFloatArray in conjunction with Float32() and Float32(float[]) constructosr.
 
Methods inherited from class galaxy.lang.BinaryObject
append, readBinaryFile, toEncodedString, toFormattedString, toString
 
Methods inherited from class galaxy.lang.GalaxyObject
getType, getTypeForObject, getTypeName, nameType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Float32

public Float32()
Creates an empty array of floats.

Float32

public Float32(byte[] data)
Deprecated. As of Galaxy Communicator 3.0. Use Float32(), Float32(float[]) and Float32(float[], boolean) constructors.

This constructor creates an object that encapsulates a reference to the specified array. If the array is null, an empty array is created.

Float32

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

Float32

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

getSize

public int getSize()
Returns the length of this object's float array. If there is no float array (i.e., the deprecated byte array is being used), the length of the byte array is returned.
Overrides:
getSize in class BinaryObject
Returns:
length of float array or byte array

append

public void append(float[] floatArray)
Appends an array of floats to this array object. Only use this method if this array object is using a float array. If it is using a byte array, this method does nothing.
Parameters:
floatArray - the array of floats to append

getFloatArray

public float[] getFloatArray()

toFloatArray

public float[] toFloatArray()
Deprecated. As of Galaxy Communicator 3.0. Use getFloatArray in conjunction with Float32() and Float32(float[]) constructosr.


getBytes

public byte[] getBytes()
Returns this array as a byte array (in big endian byte order).
Overrides:
getBytes in class BinaryObject
Returns:
the byte array or null if there is no data