Interface IntMapper


@PublicApi public interface IntMapper
Maps int values of a range [0..size-1] to other int values.
Since:
JChem 5.12
  • Method Summary

    Modifier and Type
    Method
    Description
    int[]
     
    int
    Returns the number of elements that can be mapped by map(int).
    int
    map(int index)
    Maps an int to another int.
  • Method Details

    • map

      int map(int index) throws IllegalArgumentException
      Maps an int to another int. Inputs are accepted between 0 and getSize() - 1 (inclusive).
      Parameters:
      index - the input
      Returns:
      the mapped input
      Throws:
      IllegalArgumentException - if index is out of range
    • getSize

      int getSize()
      Returns the number of elements that can be mapped by map(int). The minimum element is always zero. The maximum element is size-1 where size is the element count returned by this method. That is, the range is [0..size-1].
      Returns:
      the number of elements in the range
    • getMap

      int[] getMap()