All Implemented Interfaces:
Serializable

public class MapToUByte extends MapToByte
See Also:
  • Constructor Details

    • MapToUByte

      public MapToUByte(int unique, int size)
  • Method Details

    • getType

      public MapToFactory.MAP_TYPE getType()
      Overrides:
      getType in class MapToByte
    • getIndex

      public int getIndex(int n)
      Description copied from class: AMapToData
      Get the given index back as a integer
      Overrides:
      getIndex in class MapToByte
      Parameters:
      n - the index to get
      Returns:
      the value represented in that cell as integer
    • setAndGet

      public int setAndGet(int n, int v)
      Description copied from class: AMapToData
      Set the index to the value and get the contained value after.
      Overrides:
      setAndGet in class MapToByte
      Parameters:
      n - index to set.
      v - the value to set it to.
      Returns:
      v as encoded, note this value can be different that the one put in if the map is not able to represent the value
    • fill

      public void fill(int v)
      Description copied from class: AMapToData
      Fill the map with a given value. NOTE! The value should be representable inside the map. This requirement is not checked.
      Overrides:
      fill in class MapToByte
      Parameters:
      v - the value to fill
    • write

      public void write(DataOutput out) throws IOException
      Description copied from class: AMapToData
      Serialize this object to the DataOutput given.
      Overrides:
      write in class MapToByte
      Parameters:
      out - The object to serialize this object into.
      Throws:
      IOException - An IO exception if the Serialization fails.
    • replace

      public void replace(int v, int r)
      Description copied from class: AMapToData
      Replace v with r for all entries, NOTE! It is assumed that you call this correctly: - with two distinct values that is representable inside the given AMapToData.
      Overrides:
      replace in class MapToByte
      Parameters:
      v - The value to replace
      r - The value to put instead
    • getUpperBoundValue

      public int getUpperBoundValue()
      Description copied from class: AMapToData
      Get the maximum value that is possible to allocate inside this map.
      Overrides:
      getUpperBoundValue in class MapToByte
      Returns:
      The maximum value.
    • getCounts

      public int[] getCounts(int[] ret)
      Description copied from class: AMapToData
      Get the number of counts of each unique value contained in this map. Note that in the case the mapping is shorter than number of rows the counts sum to the number of mapped values not the number of rows.
      Overrides:
      getCounts in class MapToByte
      Parameters:
      ret - The object to return.
      Returns:
      The counts
    • decompressToRange

      public void decompressToRange(double[] c, int rl, int ru, int offR, double[] values)
      Overrides:
      decompressToRange in class MapToByte
    • decompressToRangeOff

      public void decompressToRangeOff(double[] c, int rl, int ru, int offR, double[] values)
    • decompressToRangeNoOff

      public void decompressToRangeNoOff(double[] c, int rl, int ru, double[] values)
    • resize

      public AMapToData resize(int unique)
      Description copied from class: AMapToData
      Reallocate the map, to a smaller instance if applicable. Note it does not change the length of the array, just the datatype. Note that it returns the input if the input is the smallest representation that fits, otherwise it will return something that is smaller.
      Overrides:
      resize in class MapToByte
      Parameters:
      unique - The number of tuples that should be supported in the resulting map
      Returns:
      The returned hopefully reduced map.