|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.percederberg.mib.symbol.Symbol
The base class for all symbols in the MIB file. Each symbol is typically identified by it's name, which must be unique within each MIB file.
All symbols are also present in a tree structure of symbols, each symbol having references to both it's parent and all it's children. This symbol tree should not be changed once it's created, and is intended to be created on the basis of the object identifiers.
The object identifiers are only present in some symbols, but an interface is provided for accessing it for all symbols (in order to avoid some casting and case splitting). For symbols not having object identifiers, an error should be generated runtime.
Field Summary | |
protected java.util.Vector |
children
The child symbols. |
protected int |
id
The object identifier number. |
protected java.lang.String |
name
The symbol name. |
protected Symbol |
parent
The parent symbol. |
protected Type |
type
The symbol type. |
Constructor Summary | |
Symbol()
|
Method Summary | |
protected void |
addChild(Symbol child)
Adds a child to this symbol. |
Symbol |
childAt(int index)
Returns the child at a given position. |
int |
children()
Returns the number of children to this symbol. |
boolean |
equals(java.lang.Object obj)
Checks for equality with an object. |
protected Symbol |
findChild(java.lang.String name)
Searches for a child with a given name. |
java.lang.String |
getName()
Returns the symbol name. |
java.lang.String |
getOID()
Returns the object identifier string for this object. |
Symbol |
getParent()
Returns the parent symbol. |
Type |
getType()
Returns the type of this symbol. |
boolean |
isField()
Checks if this symbol represents a data field in the model. |
boolean |
isTopField()
Checks if this symbol represents a top data field in the hierarchy. |
protected void |
removeChild(Symbol child)
Removes a child from this symbol. |
void |
setOID(int id)
Sets this symbols object identifier. |
void |
setParent(Symbol parent)
Sets the symbol parent. |
void |
setType(Type type)
Sets the type of this symbol. |
java.lang.String |
toString()
Returns a description of the symbol. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String name
protected Type type
protected int id
protected Symbol parent
protected java.util.Vector children
Constructor Detail |
public Symbol()
Method Detail |
public boolean isField()
public boolean isTopField()
public Symbol childAt(int index)
index
- the child position, 0 <= index < children()
public int children()
public java.lang.String getName()
public java.lang.String getOID()
public Symbol getParent()
public Type getType()
public void setOID(int id)
id
- the object identifier number, 0 <= idpublic void setParent(Symbol parent)
parent
- the new symbol parentpublic void setType(Type type)
type
- the symbol type informationpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- any object
public java.lang.String toString()
toString
in class java.lang.Object
protected void addChild(Symbol child)
child
- a child symbolprotected void removeChild(Symbol child)
child
- a child symbolprotected Symbol findChild(java.lang.String name)
name
- the child name
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |