Package net.sf.okapi.lib.xliff2.document
Interface IWithGroupOrUnitNode
-
- All Known Implementing Classes:
FileNode,GroupNode,WithGroupOrUnitNode
public interface IWithGroupOrUnitNodeRepresents a node that holds groups or units (or both).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GroupNodeadd(GroupNode node)Adds aGroupNodeto this object.UnitNodeadd(UnitNode node)Adds aUnitNodeto this object.GroupNodeaddGroupNode(String id)Adds aGroupNodeto this object.UnitNodeaddUnitNode(String id)Adds aUnitNodeto this object.Iterator<IGroupOrUnitNode>createGroupOrUnitIterator()Creates an iterator for the group nodes and unit nodes in this object.GroupNodegetGroupNode(String id)Gets aGroupNodefor a given id.UnitNodegetUnitNode(String id)Gets theUnitNodefor a given unit id.List<UnitNode>getUnitNodes()Gets all theUnitNodeelements of this object.
-
-
-
Method Detail
-
add
UnitNode add(UnitNode node)
Adds aUnitNodeto this object.- Parameters:
node- the unit node to add.- Returns:
- the added unit node.
- See Also:
addUnitNode(String)
-
addUnitNode
UnitNode addUnitNode(String id)
Adds aUnitNodeto this object.- Parameters:
id- the ID of the new unit.- Returns:
- the added unit node.
-
add
GroupNode add(GroupNode node)
Adds aGroupNodeto this object. If the group ID is null, it is automatically set to a UUID.- Parameters:
node- the group node to add.- Returns:
- the added group node.
- See Also:
addGroupNode(String)
-
addGroupNode
GroupNode addGroupNode(String id)
Adds aGroupNodeto this object.- Parameters:
id- the ID of the group (can be null). If the ID is null it is automatically set to a UUID.- Returns:
- the added group node.
-
getUnitNodes
List<UnitNode> getUnitNodes()
Gets all theUnitNodeelements of this object. All units at any level in this object are returned.- Returns:
- all the unit nodes for the object. The list will be empty (but never null), if no unit nodes were found.
-
getUnitNode
UnitNode getUnitNode(String id)
Gets theUnitNodefor a given unit id. The unit can be at any level in this object.- Parameters:
id- the id to look for.- Returns:
- the unit node for the given id, or null if none is found.
-
getGroupNode
GroupNode getGroupNode(String id)
Gets aGroupNodefor a given id. The group can be at any level in this object.- Parameters:
id- the id to look for.- Returns:
- the group node for the given id, or null if none is found.
-
createGroupOrUnitIterator
Iterator<IGroupOrUnitNode> createGroupOrUnitIterator()
Creates an iterator for the group nodes and unit nodes in this object.- Returns:
- a new iterator for the nodes in this object.
-
-