Main Page | Packages | Class Hierarchy | Compound List | Compound Members

de.stz.bt.fnd.datapoints.FND_Value Class Reference

List of all members.

Public Member Functions

 FND_Value ()
 FND_Value (float floatValue)
 FND_Value (int intValue)
 FND_Value (byte[] byteValue) throws IndexOutOfBoundsException
void setIntValue (int intValue)
int getIntValue ()
void setFloatValue (float floatValue)
float getFloatValue ()
void setShortRealValue (byte[] byteValue) throws IndexOutOfBoundsException
byte[] getShortRealValue ()

Detailed Description

Used to convert float and int-values into IEE754 floating point format and vice versa.

Author:
Manuel Kempf PGKempf@gmx.de
Version:
Id
FND_Value.java,v 1.4 2004/11/12 09:08:18 jseitter Exp


Constructor & Destructor Documentation

de.stz.bt.fnd.datapoints.FND_Value.FND_Value  ) 
 

Default constructor, doesn't do anything.

00029 {}

de.stz.bt.fnd.datapoints.FND_Value.FND_Value float  floatValue  ) 
 

Constructor, supplied value is stored in IEEE format.

Parameters:
floatValue Value to be stored.

00036                                      {
00037     this.setFloatValue(floatValue);
00038   }

de.stz.bt.fnd.datapoints.FND_Value.FND_Value int  intValue  ) 
 

Constructor, supplied value is stored in IEEE format.

Parameters:
intValue Value to be stored.

00045                                  {
00046     this.setIntValue(intValue);
00047   }

de.stz.bt.fnd.datapoints.FND_Value.FND_Value byte[]  byteValue  )  throws IndexOutOfBoundsException
 

Constructor, supplied value is stored in IEEE format.

Parameters:
byteValue Value to be stored.

00054                                                                       {
00055     this.setShortRealValue(byteValue);
00056   } 


Member Function Documentation

float de.stz.bt.fnd.datapoints.FND_Value.getFloatValue  ) 
 

Returns float value of stored IEEE-value.

Returns:
Float representation of stored IEEE-value.

00090                                 {
00091     return Float.intBitsToFloat(value);
00092   }

int de.stz.bt.fnd.datapoints.FND_Value.getIntValue  ) 
 

Returns integer value of stored IEEE-value.

Returns:
Integer representation of stored IEEE-value.

00071                             {
00072     int returnValue = (int)Float.intBitsToFloat(value);
00073     return returnValue;
00074   }

byte [] de.stz.bt.fnd.datapoints.FND_Value.getShortRealValue  ) 
 

Returns the stored value as a four byte array. No format conversion is done.

Returns:
A four byte array containg the stored value.

00117                                     {
00118     byte[] returnValue = new byte[4];
00119     returnValue[0] = (byte) (value >>> 24);
00120     returnValue[1] = (byte)((value >>> 16) & 0x00FF);
00121     returnValue[2] = (byte)((value >>>  8) & 0x0000FF);
00122     returnValue[3] = (byte)(value & 0x000000FF);
00123     return returnValue;
00124   }

void de.stz.bt.fnd.datapoints.FND_Value.setFloatValue float  floatValue  ) 
 

Stores float-value as IEEE-value.

Parameters:
floatValue Float-value to be stored.

00081                                                {
00082     this.value = Float.floatToIntBits(floatValue);
00083   }

void de.stz.bt.fnd.datapoints.FND_Value.setIntValue int  intValue  ) 
 

Stores Integer-Value in IEEE-format

Parameters:
intValue 

00062                                          {
00063     this.value = Float.floatToIntBits((float)intValue);
00064   }

void de.stz.bt.fnd.datapoints.FND_Value.setShortRealValue byte[]  byteValue  )  throws IndexOutOfBoundsException
 

Stores a byte array of four elements. No format conversion is done.

Parameters:
byteValue The byte array to be stored.
Exceptions:
IndexOutOfBoundsException If the array length is unequal to four.

00102                                                                                     {
00103     if (byteValue.length != 4) {
00104       throw (new IndexOutOfBoundsException("FND_Value.setShortRealValue: valueArray-length unequal to 4, current length="+byteValue.length+" required length = 4 Bytes"));
00105     }
00106     this.value  = (byteValue[0] << 24);
00107     this.value += (byteValue[1] << 16);
00108     this.value += (byteValue[2] <<  8);
00109     this.value += (byteValue[3]);
00110   }


The documentation for this class was generated from the following file:
Generated on Mon Nov 15 08:36:11 2004 for FND4J by doxygen 1.3.3