Class UniqueIdentifierMap<V>

java.lang.Object
games.stendhal.server.util.UniqueIdentifierMap<V>
Type Parameters:
V - value type
All Implemented Interfaces:
Serializable, Iterable<Map.Entry<String,​V>>

public class UniqueIdentifierMap<V> extends Object implements Serializable, Iterable<Map.Entry<String,​V>>
A map which assigns a unique id to every entry.
Author:
hendrik
See Also:
Serialized Form
  • Constructor Details

    • UniqueIdentifierMap

      public UniqueIdentifierMap(String prefix)
      Creates a new counting map.
      Parameters:
      prefix - prefix
  • Method Details

    • add

      public String add(V value)
      Adds a new entry to the map unless it is already part of it.
      Parameters:
      value - entry
      Returns:
      key
    • iterator

      public Iterator<Map.Entry<String,​V>> iterator()
      Specified by:
      iterator in interface Iterable<V>