Class ArrayMapping<K extends NumericID,V>

java.lang.Object
net.automatalib.common.util.mapping.ArrayMapping<K,V>
All Implemented Interfaces:
Function<K,V>, Mapping<K,V>, MutableMapping<K,V>, IDChangeListener<K>

public final class ArrayMapping<K extends NumericID,V> extends Object implements MutableMapping<K,V>, IDChangeListener<K>
  • Constructor Details

    • ArrayMapping

      public ArrayMapping()
    • ArrayMapping

      public ArrayMapping(int initialSize)
  • Method Details

    • get

      public V get(K elem)
      Description copied from interface: Mapping
      Get the range object elem maps to. Implementations may decide how to deal with unmapped values (default values, exceptions, etc.)
      Specified by:
      get in interface Mapping<K extends NumericID,V>
      Parameters:
      elem - object from the domain.
      Returns:
      the object from the range corresponding to elem.
    • put

      public V put(K key, V value)
      Description copied from interface: MutableMapping
      Update the mapping by overriding the value which the given key should map to.
      Specified by:
      put in interface MutableMapping<K extends NumericID,V>
      Parameters:
      key - the key
      value - the new value to be associated with the key
      Returns:
      the old value mapped by key
    • idChanged

      public void idChanged(K obj, int newId, int oldId)
      Specified by:
      idChanged in interface IDChangeListener<K extends NumericID>