info.aduna.gee.spectacle.gee
Interface LabelDispenser
- All Known Implementing Classes:
- DefaultLabelDispenser
public interface LabelDispenser
LabelDispenser is the interface for objects providing a mapping from
classifications to labels as used by the a12r publication server.
A classification must conform to these two rules:
- equals() implies identical hashCode() values
- not equals() implies that the toString() values are not equal
We did not introduce a Classifion interface though, in order to
be able to use native Java classes such as String and Integer for
Classifions.
So: a label is an opaque String object used within Spectacle.
The classification is the opaque object used within an application.
Each label can be match to the corresponding classification. The "toString()"
of this classification is the label's description.
Note that several labels may have the same classification (e.g. the 1-Integer),
and it is therefore impossible to obtain a specific label for a given classification.
However, when you require the label that corresponds to a classification, you should
ask it to the correct labeler. Only within each level of a labeler (i.e. wrapped classifier),
the mapping between labels and classifications is one-to-one.
getNewLabel
String getNewLabel(Object classification)
- Parameters:
classification - the classification to get a label for
- Returns:
- a new label for the specified description
getLabelDescription
String getLabelDescription(String label)
- Parameters:
label - the label to get the description for
- Returns:
- the description for the specified label or null when not a valid label
getLabelClassification
Object getLabelClassification(String label)
- Parameters:
label - the label to get the classification for
- Returns:
- the classification for the specified label or null when not a valid label
getLabels
Properties getLabels()
- Returns:
- the complete mapping of all labels to their descriptions
Copyright © 1997-2008 Aduna. All Rights Reserved.