Class Mapping


  • public class Mapping
    extends java.lang.Object
    Maintains a mapping from a set of integers to the same range of integers.
    • Constructor Summary

      Constructors 
      Constructor Description
      Mapping()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Removes all mappings.
      int get​(int src)
      Returns a mapping.
      void insert​(int src, int dst)
      Adds a mapping.
      void remove​(int src)
      Removes a mapping.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Mapping

        public Mapping()
    • Method Detail

      • clear

        public void clear()
        Removes all mappings.
      • insert

        public void insert​(int src,
                           int dst)
        Adds a mapping.
        Parameters:
        src - the source index
        dst - the destination index
      • remove

        public void remove​(int src)
        Removes a mapping.
        Parameters:
        src - the source index
      • get

        public int get​(int src)
        Returns a mapping.
        Parameters:
        src - the source index
        Returns:
        the destination index