Package net.sf.okapi.lib.xliff2.document
Class WithGroupOrUnitNode
- java.lang.Object
-
- net.sf.okapi.lib.xliff2.document.WithGroupOrUnitNode
-
- All Implemented Interfaces:
IWithGroupOrUnitNode
public abstract class WithGroupOrUnitNode extends Object implements IWithGroupOrUnitNode
-
-
Constructor Summary
Constructors Constructor Description WithGroupOrUnitNode()Creates a newWithGroupOrUnitNodeobject.
-
Method Summary
All Methods Instance Methods Concrete 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.
-
-
-
Constructor Detail
-
WithGroupOrUnitNode
public WithGroupOrUnitNode()
Creates a newWithGroupOrUnitNodeobject.
-
-
Method Detail
-
add
public UnitNode add(UnitNode node)
Description copied from interface:IWithGroupOrUnitNodeAdds aUnitNodeto this object.- Specified by:
addin interfaceIWithGroupOrUnitNode- Parameters:
node- the unit node to add.- Returns:
- the added unit node.
- See Also:
IWithGroupOrUnitNode.addUnitNode(String)
-
addUnitNode
public UnitNode addUnitNode(String id)
Description copied from interface:IWithGroupOrUnitNodeAdds aUnitNodeto this object.- Specified by:
addUnitNodein interfaceIWithGroupOrUnitNode- Parameters:
id- the ID of the new unit.- Returns:
- the added unit node.
-
add
public GroupNode add(GroupNode node)
Description copied from interface:IWithGroupOrUnitNodeAdds aGroupNodeto this object. If the group ID is null, it is automatically set to a UUID.- Specified by:
addin interfaceIWithGroupOrUnitNode- Parameters:
node- the group node to add.- Returns:
- the added group node.
- See Also:
IWithGroupOrUnitNode.addGroupNode(String)
-
addGroupNode
public GroupNode addGroupNode(String id)
Description copied from interface:IWithGroupOrUnitNodeAdds aGroupNodeto this object.- Specified by:
addGroupNodein interfaceIWithGroupOrUnitNode- 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
public List<UnitNode> getUnitNodes()
Description copied from interface:IWithGroupOrUnitNodeGets all theUnitNodeelements of this object. All units at any level in this object are returned.- Specified by:
getUnitNodesin interfaceIWithGroupOrUnitNode- Returns:
- all the unit nodes for the object. The list will be empty (but never null), if no unit nodes were found.
-
getUnitNode
public UnitNode getUnitNode(String id)
Description copied from interface:IWithGroupOrUnitNodeGets theUnitNodefor a given unit id. The unit can be at any level in this object.- Specified by:
getUnitNodein interfaceIWithGroupOrUnitNode- Parameters:
id- the id to look for.- Returns:
- the unit node for the given id, or null if none is found.
-
getGroupNode
public GroupNode getGroupNode(String id)
Description copied from interface:IWithGroupOrUnitNodeGets aGroupNodefor a given id. The group can be at any level in this object.- Specified by:
getGroupNodein interfaceIWithGroupOrUnitNode- Parameters:
id- the id to look for.- Returns:
- the group node for the given id, or null if none is found.
-
createGroupOrUnitIterator
public Iterator<IGroupOrUnitNode> createGroupOrUnitIterator()
Description copied from interface:IWithGroupOrUnitNodeCreates an iterator for the group nodes and unit nodes in this object.- Specified by:
createGroupOrUnitIteratorin interfaceIWithGroupOrUnitNode- Returns:
- a new iterator for the nodes in this object.
-
-