gov.nasa.pds.objectAccess.table
Class NumericTextFieldAdapter

java.lang.Object
  extended by gov.nasa.pds.objectAccess.table.DefaultFieldAdapter
      extended by gov.nasa.pds.objectAccess.table.NumericTextFieldAdapter
All Implemented Interfaces:
FieldAdapter

public class NumericTextFieldAdapter
extends DefaultFieldAdapter

Implements a field adapter for numeric fields stored in textual format, as in a character table.


Constructor Summary
NumericTextFieldAdapter()
           
 
Method Summary
 BigInteger getBigInteger(byte[] buf, int offset, int length, int startBit, int stopBit)
          Gets the field value as a Java BigInteger.
 byte getByte(byte[] buf, int offset, int length, int startBit, int stopBit)
          Gets the field value as a Java byte.
 double getDouble(byte[] buf, int offset, int length, int startBit, int stopBit)
          Gets the field value as a Java double.
 float getFloat(byte[] buf, int offset, int length, int startBit, int stopBit)
          Gets the field value as a Java float.
 int getInt(byte[] buf, int offset, int length, int startBit, int stopBit)
          Gets the field value as a Java int.
 long getLong(byte[] buf, int offset, int length, int startBit, int stopBit)
          Gets the field value as a Java long.
 short getShort(byte[] buf, int offset, int length, int startBit, int stopBit)
          Gets the field value as a Java short.
 void setBigInteger(BigInteger value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)
          Sets the field value as a Java BigInteger.
 void setByte(byte value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)
          Sets the field value as a Java byte.
 void setDouble(double value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)
          Sets the field value as a Java double.
 void setFloat(float value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)
          Sets the field value as a Java float.
 void setInt(int value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)
          Sets the field value as a Java int.
 void setLong(long value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)
          Sets the field value as a Java long.
 void setShort(short value, int offset, int length, ByteBuffer buffer, boolean isRightJustified)
          Sets the field value as a Java short.
 
Methods inherited from class gov.nasa.pds.objectAccess.table.DefaultFieldAdapter
getString, getString, setString, setString, setString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumericTextFieldAdapter

public NumericTextFieldAdapter()
Method Detail

getByte

public byte getByte(byte[] buf,
                    int offset,
                    int length,
                    int startBit,
                    int stopBit)
Description copied from interface: FieldAdapter
Gets the field value as a Java byte.

Specified by:
getByte in interface FieldAdapter
Overrides:
getByte in class DefaultFieldAdapter
Parameters:
buf - the byte array containing the field
offset - the field offset
length - the length of the field data
startBit - the start bit, for bit fields
stopBit - the stop bit, for bit fields
Returns:
the field value, as a short

getShort

public short getShort(byte[] buf,
                      int offset,
                      int length,
                      int startBit,
                      int stopBit)
Description copied from interface: FieldAdapter
Gets the field value as a Java short.

Specified by:
getShort in interface FieldAdapter
Overrides:
getShort in class DefaultFieldAdapter
Parameters:
buf - the byte array containing the field
offset - the field offset
length - the length of the field data
startBit - the start bit, for bit fields
stopBit - the stop bit, for bit fields
Returns:
the field value, as a short

getInt

public int getInt(byte[] buf,
                  int offset,
                  int length,
                  int startBit,
                  int stopBit)
Description copied from interface: FieldAdapter
Gets the field value as a Java int.

Specified by:
getInt in interface FieldAdapter
Overrides:
getInt in class DefaultFieldAdapter
Parameters:
buf - the byte array containing the field
offset - the field offset
length - the length of the field data
startBit - the start bit, for bit fields
stopBit - the stop bit, for bit fields
Returns:
the field value, as an int

getLong

public long getLong(byte[] buf,
                    int offset,
                    int length,
                    int startBit,
                    int stopBit)
Description copied from interface: FieldAdapter
Gets the field value as a Java long.

Specified by:
getLong in interface FieldAdapter
Overrides:
getLong in class DefaultFieldAdapter
Parameters:
buf - the byte array containing the field
offset - the field offset
length - the length of the field data
startBit - the start bit, for bit fields
stopBit - the stop bit, for bit fields
Returns:
the field value, as a long

getFloat

public float getFloat(byte[] buf,
                      int offset,
                      int length,
                      int startBit,
                      int stopBit)
Description copied from interface: FieldAdapter
Gets the field value as a Java float.

Specified by:
getFloat in interface FieldAdapter
Overrides:
getFloat in class DefaultFieldAdapter
Parameters:
buf - the byte array containing the field
offset - the field offset
length - the length of the field data
startBit - the start bit, for bit fields
stopBit - the stop bit, for bit fields
Returns:
the field value, as a float

getDouble

public double getDouble(byte[] buf,
                        int offset,
                        int length,
                        int startBit,
                        int stopBit)
Description copied from interface: FieldAdapter
Gets the field value as a Java double.

Specified by:
getDouble in interface FieldAdapter
Overrides:
getDouble in class DefaultFieldAdapter
Parameters:
buf - the byte array containing the field
offset - the field offset
length - the length of the field data
startBit - the start bit, for bit fields
stopBit - the stop bit, for bit fields
Returns:
the field value, as a double

getBigInteger

public BigInteger getBigInteger(byte[] buf,
                                int offset,
                                int length,
                                int startBit,
                                int stopBit)
Description copied from interface: FieldAdapter
Gets the field value as a Java BigInteger.

Specified by:
getBigInteger in interface FieldAdapter
Overrides:
getBigInteger in class DefaultFieldAdapter
Parameters:
buf - the byte array containing the field
offset - the field offset
length - the length of the field data
startBit - the start bit, for bit fields
stopBit - the stop bit, for bit fields
Returns:
the field value, as a BigInteger

setByte

public void setByte(byte value,
                    int offset,
                    int length,
                    ByteBuffer buffer,
                    boolean isRightJustified)
Description copied from interface: FieldAdapter
Sets the field value as a Java byte.

Specified by:
setByte in interface FieldAdapter
Overrides:
setByte in class DefaultFieldAdapter
Parameters:
value - the field value
offset - the field offset
length - the length of the field data

setShort

public void setShort(short value,
                     int offset,
                     int length,
                     ByteBuffer buffer,
                     boolean isRightJustified)
Description copied from interface: FieldAdapter
Sets the field value as a Java short.

Specified by:
setShort in interface FieldAdapter
Overrides:
setShort in class DefaultFieldAdapter
Parameters:
value - the field value
offset - the field offset
length - the length of the field data

setInt

public void setInt(int value,
                   int offset,
                   int length,
                   ByteBuffer buffer,
                   boolean isRightJustified)
Description copied from interface: FieldAdapter
Sets the field value as a Java int.

Specified by:
setInt in interface FieldAdapter
Overrides:
setInt in class DefaultFieldAdapter
Parameters:
value - the field value
offset - the field offset
length - the length of the field data

setLong

public void setLong(long value,
                    int offset,
                    int length,
                    ByteBuffer buffer,
                    boolean isRightJustified)
Description copied from interface: FieldAdapter
Sets the field value as a Java long.

Specified by:
setLong in interface FieldAdapter
Overrides:
setLong in class DefaultFieldAdapter
Parameters:
value - the field value
offset - the field offset
length - the length of the field data

setFloat

public void setFloat(float value,
                     int offset,
                     int length,
                     ByteBuffer buffer,
                     boolean isRightJustified)
Description copied from interface: FieldAdapter
Sets the field value as a Java float.

Specified by:
setFloat in interface FieldAdapter
Overrides:
setFloat in class DefaultFieldAdapter
Parameters:
value - the field value
offset - the field offset
length - the length of the field data

setDouble

public void setDouble(double value,
                      int offset,
                      int length,
                      ByteBuffer buffer,
                      boolean isRightJustified)
Description copied from interface: FieldAdapter
Sets the field value as a Java double.

Specified by:
setDouble in interface FieldAdapter
Overrides:
setDouble in class DefaultFieldAdapter
Parameters:
value - the field value
offset - the field offset
length - the length of the field data

setBigInteger

public void setBigInteger(BigInteger value,
                          int offset,
                          int length,
                          ByteBuffer buffer,
                          boolean isRightJustified)
Description copied from interface: FieldAdapter
Sets the field value as a Java BigInteger.

Specified by:
setBigInteger in interface FieldAdapter
Overrides:
setBigInteger in class DefaultFieldAdapter
Parameters:
value - the field value
offset - the field offset
length - the length of the field data


Copyright © 2014. All Rights Reserved.