public abstract class CtnEmptyImmutableNode extends Object implements CtnNode
AST_TEST_NODE, NT_ID_NODE, NT_TEST_BODY, NT_TEST_DOCUMENT, NT_TEST_NODE_WITH_OBJ_PROP, NT_TEST_NODE_WITH_PROP_AND_CONTENT, NT_TEST_SECTION, NT_TEST_TITLE, NT_TEST_URLEMPTY_CHILD_NAMES, NT_CUSTOM_BIT, NT_NODE_LIST, NT_PARSER_ENTITY, NT_TEXT, NT_TUPLE_1, NT_TUPLE_2, NT_TUPLE_3, NT_TUPLE_4, NT_TUPLE_5, NT_UNTYPED| Constructor and Description |
|---|
CtnEmptyImmutableNode() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(CtnNode e) |
void |
add(int index,
CtnNode element) |
boolean |
addAll(Collection<? extends CtnNode> c) |
boolean |
addAll(int index,
Collection<? extends CtnNode> c) |
boolean |
addAll(xtc.util.Pair<? extends CtnNode> p)
Appends all items from the given list to list of children.
|
void |
clear() |
void |
clearAttributes()
Removes all attributes from this node.
|
Object |
clone() |
AstNode<CtnNode> |
cloneWrapException() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
AstNode<CtnNode> |
deepClone()
Only children and children's children are cloned by this method.
|
AstNode<CtnNode> |
deepCloneWrapException() |
boolean |
equals(Object obj) |
protected String |
genMsg() |
CtnNode |
get(int index) |
<S extends CtnNode> |
get(int index,
Class<S> clazz)
Same as get(index) but casts the node to the specified type.
|
Object |
getAttribute(String name)
Retrieve the value of an attribute.
|
Map<String,Object> |
getAttributes()
Retrieve the attributes as an unmodifiable map.
|
boolean |
getBooleanAttribute(String name)
Retrieve the value of a boolean attribute.
|
String[] |
getChildNames()
Returns the names of the children.
|
int |
getIntAttribute(String name)
Retrieve the value of an integer attribute.
|
xtc.tree.Location |
getLocation() |
AstLocation |
getNativeLocation() |
abstract String |
getNodeName()
Returns the name of this node.
|
abstract int |
getNodeType()
Returns an integer value that identifies the node type.
|
String |
getNodeTypeName()
Returns the fully qualified name of this node's class.
|
Object |
getProperty(String name) |
Object |
getProperty(String name,
Object default_) |
int |
getPropertyCount() |
String |
getStringAttribute(String name)
Retrieve the value of a string attribute.
|
boolean |
hasAttribute(String name)
Check whether a certain attribute is attached to this node.
|
boolean |
hasAttributes()
Tell whether this node has any attributes attached.
|
boolean |
hasLocation() |
boolean |
hasProperties() |
boolean |
hasProperty(String name) |
int |
indexOf(Object o) |
boolean |
isEmpty() |
boolean |
isList()
Determine whether this node can have a variable number of children and
implements the
List interface (or parts of it). |
boolean |
isNodeType(int testType)
Returns
true if the given node type equals the node type
returned by getNodeType(). |
Iterator<CtnNode> |
iterator() |
int |
lastIndexOf(Object o) |
ListIterator<CtnNode> |
listIterator() |
ListIterator<CtnNode> |
listIterator(int index) |
AstNodePropertyIterator |
propertyIterator()
Return an iterator which iterates over this node's properties.
|
CtnNode |
remove(int index) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
Object |
removeAttribute(String name)
Remove an attribute from this node.
|
boolean |
retainAll(Collection<?> c) |
CtnNode |
set(int index,
CtnNode element) |
Object |
setAttribute(String name,
Object value)
Assign an attribute to this node.
|
void |
setAttributes(Map<String,Object> attrs)
Set the attributes for this node.
|
boolean |
setBooleanAttribute(String name,
boolean value)
Assign a boolean attribute to this node.
|
Integer |
setIntAttribute(String name,
Integer value)
Assign an integer attribute to this node.
|
void |
setLocation(xtc.tree.Locatable locatable) |
void |
setLocation(xtc.tree.Location location) |
void |
setNativeLocation(AstLocation location) |
Object |
setProperty(String name,
Object value) |
String |
setStringAttribute(String name,
String value)
Assign an string attribute to this node.
|
int |
size() |
List<CtnNode> |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
String |
toString() |
void |
toString(Appendable out) |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, waithashCode, replaceAll, sort, spliteratorparallelStream, removeIf, streamprotected String genMsg()
public boolean hasLocation()
hasLocation in interface xtc.tree.Locatablepublic xtc.tree.Location getLocation()
getLocation in interface xtc.tree.Locatablepublic void setLocation(xtc.tree.Location location)
setLocation in interface xtc.tree.Locatablepublic void setLocation(xtc.tree.Locatable locatable)
setLocation in interface xtc.tree.Locatablepublic boolean hasAttributes()
AstNodeAttributeInterfacehasAttributes in interface AstNodeAttributeInterfaceTrue if this node has any attributes attached,
otherwise false.public Map<String,Object> getAttributes()
AstNodeAttributeInterfacegetAttributes in interface AstNodeAttributeInterfacepublic void setAttributes(Map<String,Object> attrs)
AstNodeAttributeInterfacesetAttributes in interface AstNodeAttributeInterfaceattrs - The attributes to attach to this node.public void clearAttributes()
AstNodeAttributeInterfaceclearAttributes in interface AstNodeAttributeInterfacepublic boolean hasAttribute(String name)
AstNodeAttributeInterfacehasAttribute in interface AstNodeAttributeInterfacename - The name of the attribute to test.True if an attribute with the respective name is
attached to this node, false otherwise.public Object getAttribute(String name)
AstNodeAttributeInterfacegetAttribute in interface AstNodeAttributeInterfacename - The name of the attribute to retrieve.null if the
attribute does not exist.public Object setAttribute(String name, Object value)
AstNodeAttributeInterfacesetAttribute in interface AstNodeAttributeInterfacename - The name of the attribute.value - The value associated with the attribute.public Object removeAttribute(String name)
AstNodeAttributeInterfaceremoveAttribute in interface AstNodeAttributeInterfacename - The name of the attribute to remove.public int getIntAttribute(String name)
AstNodeAttributeInterfacegetIntAttribute in interface AstNodeAttributeInterfacename - The name of the integer attribute to retrieve.0
if the attribute does not exist.public Integer setIntAttribute(String name, Integer value)
AstNodeAttributeInterfacesetIntAttribute in interface AstNodeAttributeInterfacename - The name of the attribute.value - The integer value associated with the attribute.public boolean getBooleanAttribute(String name)
AstNodeAttributeInterfacegetBooleanAttribute in interface AstNodeAttributeInterfacename - The name of the boolean attribute to retrieve.false if the attribute does not exist.public boolean setBooleanAttribute(String name, boolean value)
AstNodeAttributeInterfacesetBooleanAttribute in interface AstNodeAttributeInterfacename - The name of the attribute.value - The boolean value associated with the attribute.null if the attribute does not exist yet.public String getStringAttribute(String name)
AstNodeAttributeInterfacegetStringAttribute in interface AstNodeAttributeInterfacename - The name of the string attribute to retrieve.null
if the attribute does not exist.public String setStringAttribute(String name, String value)
AstNodeAttributeInterfacesetStringAttribute in interface AstNodeAttributeInterfacename - The name of the attribute.value - The String value associated with the attribute.public boolean hasProperties()
hasProperties in interface AstNodePropertyInterfacepublic int getPropertyCount()
getPropertyCount in interface AstNodePropertyInterfacepublic Object getProperty(String name)
getProperty in interface AstNodePropertyInterfacepublic Object getProperty(String name, Object default_)
getProperty in interface AstNodePropertyInterfacepublic boolean hasProperty(String name)
hasProperty in interface AstNodePropertyInterfacepublic Object setProperty(String name, Object value)
setProperty in interface AstNodePropertyInterfacepublic AstNodePropertyIterator propertyIterator()
AstNodePropertyInterfacepropertyIterator in interface AstNodePropertyInterfacepublic abstract int getNodeType()
AstNodegetNodeType in interface AstNode<CtnNode>public boolean isNodeType(int testType)
AstNodetrue if the given node type equals the node type
returned by getNodeType().isNodeType in interface AstNode<CtnNode>public final String getNodeTypeName()
AstNodegetNodeTypeName in interface AstNode<CtnNode>public abstract String getNodeName()
AstNodegetNodeName in interface AstNode<CtnNode>public AstLocation getNativeLocation()
getNativeLocation in interface AstNode<CtnNode>public void setNativeLocation(AstLocation location)
setNativeLocation in interface AstNode<CtnNode>public boolean addAll(xtc.util.Pair<? extends CtnNode> p)
AstNodepublic boolean isList()
AstNodeList interface (or parts of it).public String[] getChildNames()
AstNodegetChildNames in interface AstNode<CtnNode>public void toString(Appendable out) throws IOException
toString in interface AstNode<CtnNode>IOExceptionpublic Object clone() throws CloneNotSupportedException
public AstNode<CtnNode> cloneWrapException()
cloneWrapException in interface AstNode<CtnNode>public AstNode<CtnNode> deepClone() throws CloneNotSupportedException
AstNodedeepClone in interface AstNode<CtnNode>CloneNotSupportedExceptionpublic AstNode<CtnNode> deepCloneWrapException()
deepCloneWrapException in interface AstNode<CtnNode>public boolean add(CtnNode e)
public boolean addAll(Collection<? extends CtnNode> c)
public boolean addAll(int index,
Collection<? extends CtnNode> c)
public void clear()
public boolean contains(Object o)
public boolean containsAll(Collection<?> c)
containsAll in interface Collection<CtnNode>containsAll in interface List<CtnNode>public <S extends CtnNode> S get(int index, Class<S> clazz)
AstNodepublic boolean isEmpty()
public int lastIndexOf(Object o)
lastIndexOf in interface List<CtnNode>public ListIterator<CtnNode> listIterator()
listIterator in interface List<CtnNode>public ListIterator<CtnNode> listIterator(int index)
listIterator in interface List<CtnNode>public boolean remove(Object o)
public boolean removeAll(Collection<?> c)
public boolean retainAll(Collection<?> c)
public int size()
public Object[] toArray()
public <T> T[] toArray(T[] a)
Copyright © 2009–2017 University of Erlangen-Nürnberg - Open Source Research Group. All rights reserved.