Package gov.nasa.pds.objectAccess.array
Class IntegerAdapter
- java.lang.Object
- 
- gov.nasa.pds.objectAccess.array.IntegerAdapter
 
- 
- All Implemented Interfaces:
- DataTypeAdapter
 
 public class IntegerAdapter extends java.lang.Object implements DataTypeAdapter Implements a data type adapter for 4-byte integers.
- 
- 
Constructor SummaryConstructors Constructor Description IntegerAdapter(int elementSize, boolean isBigEndian, boolean isUnsigned)Creates a new adapter for an integer of given size.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetDouble(java.nio.ByteBuffer buf)Gets the value as a double.intgetInt(java.nio.ByteBuffer buf)Gets the value as an int.longgetLong(java.nio.ByteBuffer buf)Gets the value as a long.
 
- 
- 
- 
Constructor Detail- 
IntegerAdapterpublic IntegerAdapter(int elementSize, boolean isBigEndian, boolean isUnsigned)Creates a new adapter for an integer of given size.- Parameters:
- elementSize- the number of bytes in the integer
- isBigEndian- true, if the data is big-endian, false if little-endian
- isUnsigned- true, if the data is unsigned, false if signed
 
 
- 
 - 
Method Detail- 
getIntpublic int getInt(java.nio.ByteBuffer buf) Description copied from interface:DataTypeAdapterGets the value as an int.- Specified by:
- getIntin interface- DataTypeAdapter
- Parameters:
- buf- the buffer from which to get the value
- Returns:
- the value, as an int
 
 - 
getLongpublic long getLong(java.nio.ByteBuffer buf) Description copied from interface:DataTypeAdapterGets the value as a long.- Specified by:
- getLongin interface- DataTypeAdapter
- Parameters:
- buf- the buffer from which to get the value
- Returns:
- the value, as a long
 
 - 
getDoublepublic double getDouble(java.nio.ByteBuffer buf) Description copied from interface:DataTypeAdapterGets the value as a double.- Specified by:
- getDoublein interface- DataTypeAdapter
- Parameters:
- buf- the buffer from which to get the value
- Returns:
- the value, as a double
 
 
- 
 
-