Class IndexMap.ListIndexMap<K,V>

java.lang.Object
jadex.collection.IndexMap<K,V>
jadex.collection.IndexMap.ListIndexMap<K,V>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<V>, Collection<V>, List<V>, SequencedCollection<V>
Enclosing class:
IndexMap<K,V>

public static class IndexMap.ListIndexMap<K,V> extends IndexMap<K,V> implements List<V>
Provide access to the index map via list interface.
See Also:
  • Constructor Details

    • ListIndexMap

      public ListIndexMap()
      Create a new list interface index map.
    • ListIndexMap

      public ListIndexMap(List<K> list, Map<K,V> map)
      Create a new list interface index map.
      Parameters:
      list - The list.
      map - The map.
  • Method Details

    • remove

      public boolean remove(Object o)
      Removes the first occurrence in this list of the specified element. If this list does not contain the element, it is unchanged. More formally, removes the element with the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))) (if such an element exists).
      Specified by:
      remove in interface Collection<K>
      Specified by:
      remove in interface List<K>
      Parameters:
      o - element to be removed from this list, if present.
      Returns:
      true if this list contained the specified element.
      Throws:
      ClassCastException - if the type of the specified element is incompatible with this list (optional).
      NullPointerException - if the specified element is null and this list does not support null elements (optional).
    • clone

      public Object clone()
      Clone an index map.
      Overrides:
      clone in class IndexMap<K,V>