|
jInfer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcz.cuni.mff.ksi.jinfer.base.objects.nodes.AbstractNamedNode
public abstract class AbstractNamedNode
Class implementing general features of all nodes in grammar structure. Holds information about name, context, and metadata. By default is immutable, children can implement getMutable() function, to enable creation of temporarily mutable instances, which have to be locked by calling setImmutable() after all fields are set properly.
| Field Summary | |
|---|---|
protected boolean |
mutable
Holds true when node is mutable, false when not. |
| Constructor Summary | |
|---|---|
|
AbstractNamedNode(List<String> context,
String name,
Map<String,Object> metadata)
Public constructor, creates immutable node. |
protected |
AbstractNamedNode(List<String> context,
String name,
Map<String,Object> metadata,
boolean mutable)
Create new node given all members. |
| Method Summary | |
|---|---|
List<String> |
getContext()
Context of a node is it's absolute XPath in document. |
Map<String,Object> |
getMetadata()
General map of objects not coming from document data, but describing more precisely how the data was seen. |
String |
getName()
Name of the node. |
boolean |
isMutable()
Check whether node is mutable |
void |
setImmutable()
Set object to immutable mode (cannot be changed back to mutable). |
void |
setName(String name)
Sets the name of node (if mutable). |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected boolean mutable
| Constructor Detail |
|---|
protected AbstractNamedNode(List<String> context,
String name,
Map<String,Object> metadata,
boolean mutable)
context - context of node in document (if any)name - name of the nodemetadata - any metadata associated with nodemutable - true iff node is to be created as mutable
public AbstractNamedNode(List<String> context,
String name,
Map<String,Object> metadata)
context - context of node in document (if any)name - name of the nodemetadata - any metadata associated with node| Method Detail |
|---|
public List<String> getContext()
NamedNode
getContext in interface NamedNodepublic String getName()
NamedNode
getName in interface NamedNodepublic void setName(String name)
IllegalStateException when immutable.
name - new name of nodepublic Map<String,Object> getMetadata()
NamedNode
getMetadata in interface NamedNodepublic boolean isMutable()
public void setImmutable()
public String toString()
toString in class Object
|
jInfer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||