gov.sandia.cognition.framework
Interface SemanticIdentifierMap

All Superinterfaces:
Serializable
All Known Implementing Classes:
DefaultSemanticIdentifierMap

public interface SemanticIdentifierMap
extends Serializable

The SemanticIdentifierMap defines the functionality of a class that assigns identifiers to SemanticLabels and keeps track of them.

Since:
1.0
Author:
Justin Basilico, Kevin R. Dixon

Method Summary
 SemanticIdentifier addLabel(SemanticLabel label)
          Adds a SemanticLabel to the map, or returns an existing SemanticIdentifier if already in the map
 ArrayList<SemanticIdentifier> addLabels(Collection<SemanticLabel> labels)
          Adds a list of SemanticLabels to the map, returning the list of the corresponding SemanticIdentifiers for the given SemanticLabels.
 void addSemanticIdentifierMapListener(SemanticIdentifierMapListener listener)
          Adds a listener to this semantic identifier map.
 SemanticIdentifier findIdentifier(SemanticLabel label)
          Queries into the map to find a SemanticLabel
 Collection<SemanticIdentifier> getIdentifiers()
          Gets all the SemanticIdentifiers in the map.
 void removeSemanticIdentifierMapListener(SemanticIdentifierMapListener listener)
          Removes a listener from this semantic identifier map.
 

Method Detail

findIdentifier

SemanticIdentifier findIdentifier(SemanticLabel label)
Queries into the map to find a SemanticLabel

Parameters:
label - SemanticLabel to query into the map.
Returns:
SemanticIdentifier associated with SemanticLabel, or null if not found.

addLabel

SemanticIdentifier addLabel(SemanticLabel label)
Adds a SemanticLabel to the map, or returns an existing SemanticIdentifier if already in the map

Parameters:
label - SemanticLabel to add to or retrieve from the map.
Returns:
SemanticIdentifer or null if unable to add.
Throws:
IllegalArgumentException - if label is null.

addLabels

ArrayList<SemanticIdentifier> addLabels(Collection<SemanticLabel> labels)
Adds a list of SemanticLabels to the map, returning the list of the corresponding SemanticIdentifiers for the given SemanticLabels.

Parameters:
labels - The SemanticLabels to add.
Returns:
The list of SemanticIdentifiers corresponding to the given SemanticLabels.
Throws:
IllegalArgumentException - If one of the labels is null.

getIdentifiers

Collection<SemanticIdentifier> getIdentifiers()
Gets all the SemanticIdentifiers in the map.

Returns:
All the SemanticIdentifiers in the map.

addSemanticIdentifierMapListener

void addSemanticIdentifierMapListener(SemanticIdentifierMapListener listener)
Adds a listener to this semantic identifier map.

Parameters:
listener - The listener to add.

removeSemanticIdentifierMapListener

void removeSemanticIdentifierMapListener(SemanticIdentifierMapListener listener)
Removes a listener from this semantic identifier map.

Parameters:
listener - The listener to remove.