gov.nasa.pds.objectAccess
Class FixedTableRecord

java.lang.Object
  extended by gov.nasa.pds.objectAccess.FixedTableRecord
All Implemented Interfaces:
TableRecord

public class FixedTableRecord
extends Object
implements TableRecord

Implements a fixed-width table record.


Method Summary
 void clear()
          Clears the content of the TableRecord object.
 int findColumn(String name)
          Gets the integer index of a field with the given name (1-relative).
 BigInteger getBigInteger(int index)
          Gets the field value as a Java BigInteger.
 BigInteger getBigInteger(String name)
          Gets the field value as a Java BigInteger.
 boolean getBoolean(int index)
          Gets the boolean value of a field given the index.
 boolean getBoolean(String name)
          Gets the boolean value of a field given the index.
 byte getByte(int index)
          Gets the byte value of a field given the index.
 byte getByte(String name)
          Gets the byte value of a field given the name.
 double getDouble(int index)
          Gets the double value of a field given the index.
 double getDouble(String name)
          Gets the double value of a field given the name.
 float getFloat(int index)
          Gets the float value of a field given the index.
 float getFloat(String name)
          Gets the float value of a field given the name.
 int getInt(int index)
          Gets the integer value of a field given the index.
 int getInt(String name)
          Gets the integer value of a field given the name.
 long getLong(int index)
          Gets the long value of a field given the index.
 long getLong(String name)
          Gets the long value of a field given the name.
 byte[] getRecordValue()
          Returns a byte array that stores the record value.
 short getShort(int index)
          Gets the short value of a field given the index.
 short getShort(String name)
          Gets the short value of a field given the name.
 String getString(int index)
          Gets the string value of a field given the index.
 String getString(String name)
          Gets the string value of a field given the name.
 void setByte(int index, byte value)
          Sets one byte value to a field given the index.
 void setByte(String name, byte value)
          Sets one byte value to a field given the name.
 void setDouble(int index, double value)
          Sets eight bytes containing the double value to a field given the index.
 void setDouble(String name, double value)
          Sets eight bytes containing the double value to a field given the name.
 void setFloat(int index, float value)
          Sets four bytes containing the float value to a field given the index.
 void setFloat(String name, float value)
          Sets four bytes containing the float value to a field given the name.
 void setInt(int index, int value)
          Sets four bytes containing the integer value to a field given the index.
 void setInt(String name, int value)
          Sets four bytes containing the integer value to a field given the name.
 void setLong(int index, long value)
          Sets eight bytes containing the long value to the record given the field index.
 void setLong(String name, long value)
          Sets eight bytes containing the long value to the record given the field name.
 void setRecordValue(byte[] value)
          Sets the record value.
 void setShort(int index, short value)
          Sets two bytes containing the short value to a field given the index.
 void setShort(String name, short value)
          Sets two bytes containing the short value to a field given the index.
 void setString(int index, String value)
          Sets a string value to a field given the index.
 void setString(String value)
          Sets a String value to the record at the current offset.
 void setString(String name, String value)
          Sets a string value to a field given the name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

findColumn

public int findColumn(String name)
Description copied from interface: TableRecord
Gets the integer index of a field with the given name (1-relative).

Specified by:
findColumn in interface TableRecord
Parameters:
name - the name of a field
Returns:
the integer index of a field (1-relative)

getBoolean

public boolean getBoolean(String name)
Description copied from interface: TableRecord
Gets the boolean value of a field given the index.

Specified by:
getBoolean in interface TableRecord
Parameters:
name - the field name
Returns:
the boolean value

getBoolean

public boolean getBoolean(int index)
Description copied from interface: TableRecord
Gets the boolean value of a field given the index.

Specified by:
getBoolean in interface TableRecord
Parameters:
index - the field index
Returns:
the boolean value

getShort

public short getShort(int index)
Description copied from interface: TableRecord
Gets the short value of a field given the index.

Specified by:
getShort in interface TableRecord
Parameters:
index - the column index (1-relative)
Returns:
a short value

getShort

public short getShort(String name)
Description copied from interface: TableRecord
Gets the short value of a field given the name.

Specified by:
getShort in interface TableRecord
Parameters:
name - the field name
Returns:
a short value

getByte

public byte getByte(int index)
Description copied from interface: TableRecord
Gets the byte value of a field given the index.

Specified by:
getByte in interface TableRecord
Parameters:
index - the field index (1-relative)
Returns:
a byte value

getByte

public byte getByte(String name)
Description copied from interface: TableRecord
Gets the byte value of a field given the name.

Specified by:
getByte in interface TableRecord
Parameters:
name - the field name
Returns:
a byte value

getLong

public long getLong(int index)
Description copied from interface: TableRecord
Gets the long value of a field given the index.

It throws NumberFormatException if the number is out of range when converting from ASCII_Integer to long.

Specified by:
getLong in interface TableRecord
Parameters:
index - the field index (1-relative)
Returns:
a long value

getLong

public long getLong(String name)
Description copied from interface: TableRecord
Gets the long value of a field given the name.

Specified by:
getLong in interface TableRecord
Parameters:
name - the field name
Returns:
a long value

getInt

public int getInt(String name)
Description copied from interface: TableRecord
Gets the integer value of a field given the name.

Specified by:
getInt in interface TableRecord
Parameters:
name - the field name
Returns:
an integer value

getInt

public int getInt(int index)
Description copied from interface: TableRecord
Gets the integer value of a field given the index.

It throws NumberFormatException if the number is out of range when converting from ASCII_Integer to int.

Specified by:
getInt in interface TableRecord
Parameters:
index - the field index (1-relative)
Returns:
an integer value

getBigInteger

public BigInteger getBigInteger(String name)
Description copied from interface: TableRecord
Gets the field value as a Java BigInteger.

Specified by:
getBigInteger in interface TableRecord
Parameters:
name - the name of the field
Returns:
the field value, as a BigInteger

getBigInteger

public BigInteger getBigInteger(int index)
Description copied from interface: TableRecord
Gets the field value as a Java BigInteger.

Specified by:
getBigInteger in interface TableRecord
Parameters:
index - the field index
Returns:
the field value, as a BigInteger

getDouble

public double getDouble(String name)
Description copied from interface: TableRecord
Gets the double value of a field given the name.

Specified by:
getDouble in interface TableRecord
Parameters:
name - the field name
Returns:
a double value

getDouble

public double getDouble(int index)
Description copied from interface: TableRecord
Gets the double value of a field given the index.

If the number is out of range when converting from ASCII_Real to double, the method returns Double.POSITIVE_INFINITY or Double.NEGATIVE_INFINITY.

Specified by:
getDouble in interface TableRecord
Parameters:
index - the field index (1-relative)
Returns:
a double value

getFloat

public float getFloat(String name)
Description copied from interface: TableRecord
Gets the float value of a field given the name.

Specified by:
getFloat in interface TableRecord
Parameters:
name - the field name
Returns:
a float value

getFloat

public float getFloat(int index)
Description copied from interface: TableRecord
Gets the float value of a field given the index.

If the number is out of range when converting from ASCII_Real to float, the method returns Float.POSITIVE_INFINITY or Float.NEGATIVE_INFINITY.

Specified by:
getFloat in interface TableRecord
Parameters:
index - the field index (1-relative)
Returns:
a float value

getString

public String getString(String name)
Description copied from interface: TableRecord
Gets the string value of a field given the name.

Specified by:
getString in interface TableRecord
Parameters:
name - the field name
Returns:
a String value

getString

public String getString(int index)
Description copied from interface: TableRecord
Gets the string value of a field given the index.

Specified by:
getString in interface TableRecord
Parameters:
index - the field index (1-relative)
Returns:
a String value

setString

public void setString(int index,
                      String value)
Description copied from interface: TableRecord
Sets a string value to a field given the index. In a fixed-width text file, numeric values are right justified and non-numeric values are left justified.

Specified by:
setString in interface TableRecord
Parameters:
index - the field index (1-relative)
value - a string value

setString

public void setString(String name,
                      String value)
Description copied from interface: TableRecord
Sets a string value to a field given the name. In a fixed-width text file, numeric values are right justified and non-numeric values are left justified.

Specified by:
setString in interface TableRecord
Parameters:
name - the field name
value - a string value

setString

public void setString(String value)
Description copied from interface: TableRecord
Sets a String value to the record at the current offset. Use this method to write a field delimiter in fixed-width text file.

Specified by:
setString in interface TableRecord
Parameters:
value - a String value

setInt

public void setInt(int index,
                   int value)
Description copied from interface: TableRecord
Sets four bytes containing the integer value to a field given the index.

Specified by:
setInt in interface TableRecord
Parameters:
index - the field index (1-relative)
value - an integer value

setInt

public void setInt(String name,
                   int value)
Description copied from interface: TableRecord
Sets four bytes containing the integer value to a field given the name.

Specified by:
setInt in interface TableRecord
Parameters:
name - the field name
value - an integer value

setDouble

public void setDouble(int index,
                      double value)
Description copied from interface: TableRecord
Sets eight bytes containing the double value to a field given the index.

Specified by:
setDouble in interface TableRecord
Parameters:
index - the field index (1-relative)
value - a double value

setDouble

public void setDouble(String name,
                      double value)
Description copied from interface: TableRecord
Sets eight bytes containing the double value to a field given the name.

Specified by:
setDouble in interface TableRecord
Parameters:
name - the field name
value - a double value

setFloat

public void setFloat(int index,
                     float value)
Description copied from interface: TableRecord
Sets four bytes containing the float value to a field given the index.

Specified by:
setFloat in interface TableRecord
Parameters:
index - the field index (1-relative)
value - a float value

setFloat

public void setFloat(String name,
                     float value)
Description copied from interface: TableRecord
Sets four bytes containing the float value to a field given the name.

Specified by:
setFloat in interface TableRecord
Parameters:
name - the field name
value - a float value

setLong

public void setLong(int index,
                    long value)
Description copied from interface: TableRecord
Sets eight bytes containing the long value to the record given the field index.

Specified by:
setLong in interface TableRecord
Parameters:
index - the field index (1-relative)
value - a long value

setLong

public void setLong(String name,
                    long value)
Description copied from interface: TableRecord
Sets eight bytes containing the long value to the record given the field name.

Specified by:
setLong in interface TableRecord
Parameters:
name - the field name
value - a long value

setShort

public void setShort(int index,
                     short value)
Description copied from interface: TableRecord
Sets two bytes containing the short value to a field given the index.

Specified by:
setShort in interface TableRecord
Parameters:
index - the field index (1-relative)
value - a short value

setShort

public void setShort(String name,
                     short value)
Description copied from interface: TableRecord
Sets two bytes containing the short value to a field given the index.

Specified by:
setShort in interface TableRecord
Parameters:
name - the field name
value - a short value

setByte

public void setByte(int index,
                    byte value)
Description copied from interface: TableRecord
Sets one byte value to a field given the index.

Specified by:
setByte in interface TableRecord
Parameters:
index - the field index (1-relative)
value - a byte value

setByte

public void setByte(String name,
                    byte value)
Description copied from interface: TableRecord
Sets one byte value to a field given the name.

Specified by:
setByte in interface TableRecord
Parameters:
name - the field name
value - a byte value

clear

public void clear()
Description copied from interface: TableRecord
Clears the content of the TableRecord object.

Specified by:
clear in interface TableRecord

setRecordValue

public void setRecordValue(byte[] value)
Sets the record value.

Parameters:
value - byte array that contains the record value

getRecordValue

public byte[] getRecordValue()
Returns a byte array that stores the record value.

Returns:
a byte array that contains the record value


Copyright © 2014. All Rights Reserved.