Class ProductData.UShort

All Implemented Interfaces:
Cloneable
Enclosing class:
ProductData

public static class ProductData.UShort extends ProductData.Short
The UShort class is a ProductData specialisation for unsigned 16-bit integer fields.

Internally, data is stored in an array of the type short[].

In order to preserve the accuracy for the unsigned byte value range the getElemIntAt method should be used to retrieve the data stored in this value instead of accessing the data array directly.

Another method is to mask each of the array elements in order to get the unsigned type in the following way:

     short[] data = (short[]) value.getRaster();
     for (int i = 0; i < data.length; i++) {
         int value = data[i] & 0xffff;
         ...
     }
 
  • Constructor Details

    • UShort

      public UShort(int numElems)
      Constructs a new unsigned short value.
      Parameters:
      numElems - the number of elements, must not be less than one
    • UShort

      public UShort(short[] array)
      Constructs a new unsigned short value.
      Parameters:
      array - the elements
  • Method Details