The Octet Molecular Representation Framework v0.8.2

net.sf.octet.collection
Class BasicAtomMap

java.lang.Object
  extended bynet.sf.octet.collection.BasicAtomMap
All Implemented Interfaces:
AtomMap

public class BasicAtomMap
extends java.lang.Object
implements AtomMap

A default implementation of the AtomMap interface backed by a HashMap.

Author:
Richard Apodaca

Constructor Summary
BasicAtomMap(java.util.Map map)
          Constructs a fully functional BasicAtomMap using the specified Map for the mapping relationships.
 
Method Summary
 boolean containsKey(Atom key)
          Returns true if key is contained among the keys in this AtomMap or false otherwise.
 boolean containsValue(Atom value)
          Returns true if value is contained among the values in this AtomMap.
 int countAtomEntries()
          Returns the number of associations.
 Atom getAtom(Atom key)
          Returns the Atom associated with key.
 AtomIterator iterateAtomKeys()
          Returns an AtomIterator over all keys.
 AtomIterator iterateAtomValues()
          Returns an AtomIterator over all values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicAtomMap

public BasicAtomMap(java.util.Map map)
Constructs a fully functional BasicAtomMap using the specified Map for the mapping relationships. The contents of map are copied to a new instance of a HashMap.

Parameters:
map - the map containing Atom key/value relationships
Throws:
java.lang.IllegalArgumentException - if map contains null, or any of the keys/values do not implement the Atom interface
Method Detail

getAtom

public Atom getAtom(Atom key)
Description copied from interface: AtomMap
Returns the Atom associated with key.

Specified by:
getAtom in interface AtomMap
Parameters:
key - the Atom key
Returns:
the Atom associated with key

countAtomEntries

public int countAtomEntries()
Description copied from interface: AtomMap
Returns the number of associations.

Specified by:
countAtomEntries in interface AtomMap
Returns:
the number of associations.

iterateAtomKeys

public AtomIterator iterateAtomKeys()
Description copied from interface: AtomMap
Returns an AtomIterator over all keys.

Specified by:
iterateAtomKeys in interface AtomMap
Returns:
an AtomIterator over all keys

containsKey

public boolean containsKey(Atom key)
Description copied from interface: AtomMap
Returns true if key is contained among the keys in this AtomMap or false otherwise.

Specified by:
containsKey in interface AtomMap
Parameters:
key - the Atom key
Returns:
true if found, or false otherwise

containsValue

public boolean containsValue(Atom value)
Description copied from interface: AtomMap
Returns true if value is contained among the values in this AtomMap.

Specified by:
containsValue in interface AtomMap
Parameters:
value - the Atom value
Returns:
true if found, or false otherwise

iterateAtomValues

public AtomIterator iterateAtomValues()
Description copied from interface: AtomMap
Returns an AtomIterator over all values.

Specified by:
iterateAtomValues in interface AtomMap
Returns:
an AtomIterator over all values

The Octet Molecular Representation Framework v0.8.2