|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.brics.xmlgraph.Node dk.brics.xmlgraph.MultiContentNode dk.brics.xmlgraph.ChoiceNode
public class ChoiceNode
Choice/gap node.
Field Summary |
---|
Fields inherited from class dk.brics.xmlgraph.MultiContentNode |
---|
contents |
Fields inherited from class dk.brics.xmlgraph.Node |
---|
index, origin |
Constructor Summary | |
---|---|
ChoiceNode(Collection<Integer> content,
Origin origin)
Constructs a new non-gap choice node. |
|
ChoiceNode(String name,
boolean open,
boolean removed,
Collection<Integer> content,
Origin origin)
Constructs a new gap choice node. |
Method Summary | ||
---|---|---|
protected ChoiceNode |
clone()
Clones this node. |
|
String |
getName()
Returns the gap name. |
|
Collection<Integer> |
getSortedContents()
Returns indices of sub-nodes in order. |
|
boolean |
isGap()
Returns true if this is a gap node. |
|
boolean |
isOpen()
Returns true if this gap may be open. |
|
boolean |
isOptional(XMLGraph xg)
Returns true if this node has an empty choice or is open or removed. |
|
boolean |
isRemoved()
Returns true if this gap may be removed. |
|
|
process(NodeProcessor<T> v)
Applies the given node processor on this node. |
|
void |
setContent(Collection<Integer> content,
XMLGraph xg)
Sets the outgoing edges. |
|
void |
setContentAndStatus(boolean open,
boolean removed,
Collection<Integer> content,
XMLGraph xg)
Sets the outgoing edges and gap status. |
Methods inherited from class dk.brics.xmlgraph.MultiContentNode |
---|
getContents, setContents |
Methods inherited from class dk.brics.xmlgraph.Node |
---|
getIndex, getOrigin, setOrigin |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChoiceNode(Collection<Integer> content, Origin origin)
content
- outgoing edges representing the possible plugs/choicesorigin
- source information (null if not applicable)public ChoiceNode(String name, boolean open, boolean removed, Collection<Integer> content, Origin origin)
name
- gap nameopen
- true if maybe open gapremoved
- true if maybe removed gapcontent
- outgoing edges representing the possible plugs/choicesorigin
- source information (null if not applicable)Method Detail |
---|
protected ChoiceNode clone()
Node
clone
in class MultiContentNode
public String getName()
public Collection<Integer> getSortedContents()
MultiContentNode
getSortedContents
in class MultiContentNode
public boolean isGap()
public boolean isOpen()
public boolean isOptional(XMLGraph xg)
xg
- XML graph containing this node
public boolean isRemoved()
public <T> T process(NodeProcessor<T> v)
Node
process
in class Node
T
- return typev
- node processor
public void setContent(Collection<Integer> content, XMLGraph xg)
content
- outgoing edgesxg
- the current XML graphpublic void setContentAndStatus(boolean open, boolean removed, Collection<Integer> content, XMLGraph xg)
open
- true if maybe open gapremoved
- true if maybe removed gapcontent
- outgoing edgesxg
- the current XML graph
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |