dk.brics.xmlgraph
Class MultiContentNode

java.lang.Object
  extended by dk.brics.xmlgraph.Node
      extended by dk.brics.xmlgraph.MultiContentNode
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
ChoiceNode, InterleaveNode, SequenceNode

public abstract class MultiContentNode
extends Node

Abstract superclass for nodes with multiple sub-nodes.

See Also:
Serialized Form

Field Summary
protected  Collection<Integer> contents
          Collection of indices of sub-nodes.
 
Fields inherited from class dk.brics.xmlgraph.Node
index, origin
 
Constructor Summary
MultiContentNode(Collection<Integer> contents, Origin origin)
          Constructor for nodes with multiple sub-nodes.
 
Method Summary
protected abstract  MultiContentNode clone()
          Clones this node.
 Collection<Integer> getContents()
          Returns indices of sub-nodes.
 Collection<Integer> getSortedContents()
          Returns indices of sub-nodes in order.
 void setContents(Collection<Integer> contents)
          Sets the sub-nodes.
 
Methods inherited from class dk.brics.xmlgraph.Node
getIndex, getOrigin, process, setOrigin
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contents

protected Collection<Integer> contents
Collection of indices of sub-nodes.

Constructor Detail

MultiContentNode

public MultiContentNode(Collection<Integer> contents,
                        Origin origin)
Constructor for nodes with multiple sub-nodes.

Parameters:
contents - indices of sub-nodes
origin - source information (null if not applicable)
Method Detail

clone

protected abstract MultiContentNode clone()
Description copied from class: Node
Clones this node.

Specified by:
clone in class Node

getContents

public Collection<Integer> getContents()
Returns indices of sub-nodes.

Returns:
collection of node indices (should not be modified by caller)

getSortedContents

public Collection<Integer> getSortedContents()
Returns indices of sub-nodes in order.

Returns:
ordered collection of node indices (should not be modified by caller)

setContents

public void setContents(Collection<Integer> contents)
Sets the sub-nodes.

Parameters:
contents - collection of node indices


Copyright © 2005-2010 Anders Møller.