private void convertScaleOffsetUnsignedShort(IndexIterator iterIn, IndexIterator iterOut) {
   boolean checkMissing = useNaNs && hasMissing();
   while (iterIn.hasNext()) {
     short valb = iterIn.getShortNext();
     double val = scale * DataType.unsignedShortToInt(valb) + offset;
     iterOut.setDoubleNext(checkMissing && isMissing_(val) ? Double.NaN : val);
   }
 }
  public double convertScaleOffsetMissing(short vals) {
    if (!hasScaleOffset) return useNaNs && isMissing((double) vals) ? Double.NaN : (double) vals;

    double convertedValue;
    if (isUnsigned) convertedValue = scale * DataType.unsignedShortToInt(vals) + offset;
    else convertedValue = scale * vals + offset;

    return useNaNs && isMissing(convertedValue) ? Double.NaN : convertedValue;
  }
Exemplo n.º 3
0
 public int getInt(int index) {
   short val = storage[index];
   return (unsigned ? DataType.unsignedShortToInt(val) : val);
 }
Exemplo n.º 4
0
 public char getChar(int index) {
   short val = storage[index];
   return (char) (unsigned ? DataType.unsignedShortToInt(val) : val);
 }
Exemplo n.º 5
0
 public float getFloat(int index) {
   short val = storage[index];
   return (float) (unsigned ? DataType.unsignedShortToInt(val) : val);
 }
Exemplo n.º 6
0
 public long getLong(int index) {
   short val = storage[index];
   return (long) (unsigned ? DataType.unsignedShortToInt(val) : val);
 }
Exemplo n.º 7
0
 // package private : mostly for iterators
 public double getDouble(int index) {
   short val = storage[index];
   return (double) (unsigned ? DataType.unsignedShortToInt(val) : val);
 }
Exemplo n.º 8
0
 public char getChar(Index i) {
   short val = storage[i.currentElement()];
   return (char) (unsigned ? DataType.unsignedShortToInt(val) : val);
 }
Exemplo n.º 9
0
 public int getInt(Index i) {
   short val = storage[i.currentElement()];
   return (unsigned ? DataType.unsignedShortToInt(val) : val);
 }
Exemplo n.º 10
0
 public long getLong(Index i) {
   short val = storage[i.currentElement()];
   return (long) (unsigned ? DataType.unsignedShortToInt(val) : val);
 }
Exemplo n.º 11
0
 public double getDouble(Index i) {
   short val = storage[i.currentElement()];
   return (double) (unsigned ? DataType.unsignedShortToInt(val) : val);
 }