info.aduna.gee.spectacle.gee
Class Labeler

java.lang.Object
  extended by info.aduna.gee.spectacle.gee.Labeler

public class Labeler
extends Object

Class Labeler represents a mapping between classification (as maintained by a Classifier) and labels (as used by the a12r publication server).


Constructor Summary
Labeler(EntityContext context, Classifier classifier)
          Construct a new Labeler.
 
Method Summary
 Map<String,Object> getClassifications()
           
 Map<String,Object> getClassifications(int level)
           
 int getDepth()
           
 String getLabel(Object classification)
           
 String getLabel(Object classification, int level)
           
 Map<String,String> getLabels()
           
 Map<String,String> getLabels(int level)
           
 void label()
          Perform the actual labelling of all entities in this labelers context, using this labelers classification.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Labeler

public Labeler(EntityContext context,
               Classifier classifier)
Construct a new Labeler.

Parameters:
context - the context from which to obtain the labels
classifier - the classifier used to classify the entities
Method Detail

getDepth

public int getDepth()
Returns:
the depth of this Labeler, i.e. the number of hierarchical levels this lableler supports.

getLabels

public Map<String,String> getLabels()
Returns:
the complete set of labels maintained by this labeller, mapped to their descriptions

getLabels

public Map<String,String> getLabels(int level)
Parameters:
level - the hierarchical level to get the labels from
Returns:
the set of labels at the specified level, mapped to their descriptions

getClassifications

public Map<String,Object> getClassifications()
Returns:
the complete set of labels maintained by this labeller, mapped to their classifications

getClassifications

public Map<String,Object> getClassifications(int level)
Parameters:
level - the hierarchical level to get the labels from
Returns:
the set of labels at the specified level, mapped to their classifications

getLabel

public String getLabel(Object classification)
Parameters:
classification - the classification to get the label for
Returns:
the label assigned to the specified classification at any level, or null if the classification could not be found

getLabel

public String getLabel(Object classification,
                       int level)
Parameters:
classification - the classification to get the label for
level - the hierarchical level
Returns:
the label assigned to the specified classification at the specified level, or null if the classification could not be found at this level

label

public void label()
Perform the actual labelling of all entities in this labelers context, using this labelers classification.



Copyright © 1997-2008 Aduna. All Rights Reserved.