jInfer

cz.cuni.mff.ksi.jinfer.base.objects.nodes
Class Element

java.lang.Object
  extended by cz.cuni.mff.ksi.jinfer.base.objects.nodes.AbstractNamedNode
      extended by cz.cuni.mff.ksi.jinfer.base.objects.nodes.AbstractStructuralNode
          extended by cz.cuni.mff.ksi.jinfer.base.objects.nodes.Element
All Implemented Interfaces:
NamedNode, StructuralNode

public class Element
extends AbstractStructuralNode

Class representing a XML element.


Field Summary
 
Fields inherited from class cz.cuni.mff.ksi.jinfer.base.objects.nodes.AbstractNamedNode
mutable
 
Constructor Summary
Element(List<String> context, String name, Map<String,Object> metadata, Regexp<AbstractStructuralNode> subnodes, List<Attribute> attributes)
          Create immutable element given all members.
 
Method Summary
 List<Attribute> getAttributes()
          Get all attributes of element
static Element getMutable()
          Standard method of obtaining empty mutable element.
 Regexp<AbstractStructuralNode> getSubnodes()
          Get the subnodes regexp.
 StructuralNodeType getType()
           
 void setImmutable()
          Set object to immutable mode (cannot be changed back to mutable).
 String toString()
           
 
Methods inherited from class cz.cuni.mff.ksi.jinfer.base.objects.nodes.AbstractStructuralNode
isElement, isSimpleData
 
Methods inherited from class cz.cuni.mff.ksi.jinfer.base.objects.nodes.AbstractNamedNode
getContext, getMetadata, getName, isMutable, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface cz.cuni.mff.ksi.jinfer.base.interfaces.nodes.NamedNode
getContext, getMetadata, getName
 

Constructor Detail

Element

public Element(List<String> context,
               String name,
               Map<String,Object> metadata,
               Regexp<AbstractStructuralNode> subnodes,
               List<Attribute> attributes)
Create immutable element given all members.

Parameters:
context - context of the element in document (if any)
name - name of the node
metadata - any metadata associated with the node
subnodes - regular expression representing subnodes of the element (content model)
attributes - attributes of the element
Method Detail

getMutable

public static Element getMutable()
Standard method of obtaining empty mutable element. Be sure to set all members properly before using the element or calling setImmutable().

Returns:
new Element with empty fields, which is mutable

getType

public StructuralNodeType getType()
Specified by:
getType in interface StructuralNode
Specified by:
getType in class AbstractStructuralNode
Returns:
enum value of type of actual instance.

getSubnodes

public Regexp<AbstractStructuralNode> getSubnodes()
Get the subnodes regexp.

Returns:
subnodes

getAttributes

public List<Attribute> getAttributes()
Get all attributes of element

Returns:
list of attributes

setImmutable

public void setImmutable()
Description copied from class: AbstractNamedNode
Set object to immutable mode (cannot be changed back to mutable). Lock the node for changing.

Overrides:
setImmutable in class AbstractNamedNode

toString

public String toString()
Overrides:
toString in class AbstractStructuralNode

jInfer

Generated on Fri Dec 9 00:01:25 CET 2011