|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mulan.data.LabelsMetaDataImpl
public class LabelsMetaDataImpl
Implementation of LabelsMetaData
info about labels and their structure.
LabelsMetaData
,
Serialized FormConstructor Summary | |
---|---|
LabelsMetaDataImpl()
Creates a new instance of LabelsMetaDataImpl . |
Method Summary | |
---|---|
void |
addRootNode(LabelNode rootNode)
Adds a root LabelNode . |
LabelsMetaData |
clone()
Returns a deep copy of the LabelsMetaDataImpl instance. |
boolean |
containsLabel(String labelName)
Determines if LabelsMetaData contains a label with specified name. |
Set<String> |
getLabelNames()
Gets the names of all labels. |
LabelNode |
getLabelNode(String labelName)
Gets the LabelNode specified by label name. |
int |
getNumLabels()
Gets the total number of LabelNode nodes. |
Set<LabelNode> |
getRootLabels()
Gets the unmodifiable Set of root LabelNode
nodes of label attributes hierarchy. |
boolean |
isHierarchy()
Determines if there is a hierarchy defined between labels. |
void |
readExternal(ObjectInput in)
|
int |
removeLabelNode(String labelName)
Removes LabelNode specified by the name. |
void |
writeExternal(ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LabelsMetaDataImpl()
LabelsMetaDataImpl
.
Method Detail |
---|
public void addRootNode(LabelNode rootNode)
LabelNode
. The node is assumed to has linked all
related child nodes, if they exists.
The node is added into root set and all child nodes are added into internal mapping.
The node is uniquely identified by the label name.
rootNode
- the root node with underlying hierarchy of nodes
ArgumentNullException
- if specified root node is nullpublic LabelNode getLabelNode(String labelName)
LabelsMetaData
LabelNode
specified by label name. The name is unique identifier
of the node and corresponds to label attribute in the data set.
If LabelNode
for given label name does not exists, null
is returned.
getLabelNode
in interface LabelsMetaData
labelName
- the name of label of which the node should be retrieved
LabelNode
for specified label of null
if LabelNode
does not exists for specified label namepublic Set<String> getLabelNames()
LabelsMetaData
getLabelNames
in interface LabelsMetaData
public boolean containsLabel(String labelName)
LabelsMetaData
LabelsMetaData
contains a label with specified name.
containsLabel
in interface LabelsMetaData
labelName
- the label name
true
if meta data contains the given label name;
false
otherwise.public boolean isHierarchy()
LabelsMetaData
LabelNode
nodes.
isHierarchy
in interface LabelsMetaData
true
if there is hierarchy defined between labels;
false
otherwise.public int getNumLabels()
LabelsMetaData
LabelNode
nodes.
getNumLabels
in interface LabelsMetaData
LabelNode
nodespublic Set<LabelNode> getRootLabels()
LabelsMetaData
Set
of root LabelNode
nodes of label attributes hierarchy.
getRootLabels
in interface LabelsMetaData
Set
of root nodes.public LabelsMetaData clone()
LabelsMetaData
LabelsMetaDataImpl
instance.
clone
in interface LabelsMetaData
clone
in class Object
LabelsMetaDataImpl
instancepublic int removeLabelNode(String labelName)
LabelNode
specified by the name. If there is a hierarchy between
label nodes, whole subtree with all its children is also removed.
labelName
- the name of LabelNode
to be removed
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |