net.percederberg.mib.symbol
Class TypeSymbol
java.lang.Object
|
+--net.percederberg.mib.symbol.Symbol
|
+--net.percederberg.mib.symbol.TypeSymbol
- public class TypeSymbol
- extends Symbol
A class containing a type symbol from the MIB file. Type symbols
does not support having children, neither do they have object
identifiers. The corresponding methods from Symbol have been
overridden to generate errors when inserting these.
Type symbols typically contains a name and a type (which should be
set upon type analysis). The symbols may also link to a parent
symbol.
- Version:
- 1.0
- Author:
- Per Cederberg, per@percederberg.net
Constructor Summary |
TypeSymbol(java.lang.String name)
Creates a new type symbol with the given name. |
Method Summary |
protected void |
addChild(Symbol child)
Throws an exception, since this operation is not allowed for
type symbols. |
java.lang.String |
getOID()
Returns an empty string, as types have no object identifiers. |
void |
setOID(int id)
Throws an exception, since this operation is not allowed for
type symbols. |
Methods inherited from class net.percederberg.mib.symbol.Symbol |
childAt, children, equals, findChild, getName, getParent, getType, isField, isTopField, removeChild, setParent, setType, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TypeSymbol
public TypeSymbol(java.lang.String name)
- Creates a new type symbol with the given name.
- Parameters:
name
- the symbol name
getOID
public java.lang.String getOID()
- Returns an empty string, as types have no object identifiers.
- Overrides:
getOID
in class Symbol
- Returns:
- an empty string
setOID
public void setOID(int id)
throws java.lang.UnsupportedOperationException
- Throws an exception, since this operation is not allowed for
type symbols.
- Overrides:
setOID
in class Symbol
- Parameters:
id
- the new OID- Throws:
java.lang.UnsupportedOperationException
- thrown as this
operation is not supported
addChild
protected void addChild(Symbol child)
throws java.lang.UnsupportedOperationException
- Throws an exception, since this operation is not allowed for
type symbols.
- Overrides:
addChild
in class Symbol
- Parameters:
child
- the child symbol- Throws:
java.lang.UnsupportedOperationException
- thrown as this
operation is not supported