private final double readDatum(final DataInput in,final ColumnType columnType) throws IOException {
switch (columnType) {
case DOUBLE:
    return in.readDouble();
case INTEGER:
  int iValue=in.readInt();
if (iValue == Integer.MIN_VALUE + 1) {
  boolean isMissing=in.readBoolean();
  if (isMissing) {
    return Double.NaN;
  }
 else {
    return iValue;
  }
}
 else {
  return iValue;
}
case NOMINAL_BYTE:
byte bValue=in.readByte();
if (bValue == -1) {
return Double.NaN;
}
 else {
return bValue;
}
case NOMINAL_INTEGER:
iValue=in.readInt();
if (iValue == -1) {
return Double.NaN;
}
 else {
return iValue;
}
case NOMINAL_SHORT:
short sValue=in.readShort();
if (sValue == -1) {
return Double.NaN;
}
 else {
return sValue;
}
default :
throw new RuntimeException("Illegal type: " + columnType);
}
}

private final double readDatum ( final DataInput in , final ColumnType columnType ) throws IOException { switch ( columnType ) { case DOUBLE : return in . readDouble ( ) ; case INTEGER : int iValue = in . readInt ( ) ; if ( iValue == Integer . MIN_VALUE + 1 ) { boolean isMissing = in . readBoolean ( ) ; if ( isMissing ) { return Double . NaN ; } else { return iValue ; } } else { return iValue ; } case NOMINAL_BYTE : byte bValue = in . readByte ( ) ; if ( bValue == - 1 ) { return Double . NaN ; } else { return bValue ; } case NOMINAL_INTEGER : iValue = in . readInt ( ) ; if ( iValue == - 1 ) { return Double . NaN ; } else { return iValue ; } case NOMINAL_SHORT : short sValue = in . readShort ( ) ; if ( sValue == - 1 ) { return Double . NaN ; } else { return sValue ; } default : throw new RuntimeException ( "Illegal type: " + columnType ) ; } }
reads a single datum in non - sparse representation of the given type and returns it as a double .
