net.percederberg.mibble
Class Mib

java.lang.Object
  |
  +--net.percederberg.mibble.Mib
All Implemented Interfaces:
MibContext

public class Mib
extends java.lang.Object
implements MibContext

An SNMP MIB container. This class contains all the information from a MIB file, including all defined types and values. MIB files are loaded through a MIB loader.

Since:
2.0
See Also:
"RFC 3411 - An Architecture for Describing SNMP Management Frameworks"

Method Summary
 boolean equals(java.lang.Object obj)
          Compares this MIB to another object.
 java.util.Collection getAllSymbols()
          Returns all symbols in this MIB.
 java.io.File getFile()
          Returns the MIB file.
 net.percederberg.mibble.MibReference getImport(java.lang.String name)
          Returns an imported MIB reference.
 MibLoader getLoader()
          Returns the MIB loader used when loading this MIB.
 MibLoaderLog getLog()
          Returns the loader log used when loading this MIB.
 java.lang.String getName()
          Returns the MIB name.
 MibSymbol getSymbol(java.lang.String name)
          Returns a symbol from this MIB.
 MibValueSymbol getSymbolByValue(MibValue value)
          Returns a value symbol from this MIB.
 MibValueSymbol getSymbolByValue(java.lang.String value)
          Returns a value symbol from this MIB.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

equals

public boolean equals(java.lang.Object obj)
Compares this MIB to another object. This method will return true if the object is a string containing the MIB name, a file containing the MIB file, or a Mib having the same name.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare with
Returns:
true if the objects are equal, or false otherwise

getName

public java.lang.String getName()
Returns the MIB name.

Returns:
the MIB name

getFile

public java.io.File getFile()
Returns the MIB file.

Returns:
the MIB file

getLoader

public MibLoader getLoader()
Returns the MIB loader used when loading this MIB.

Returns:
the loader used

getLog

public MibLoaderLog getLog()
Returns the loader log used when loading this MIB.

Returns:
the loader log used

getImport

public net.percederberg.mibble.MibReference getImport(java.lang.String name)
Returns an imported MIB reference.

Parameters:
name - the MIB name
Returns:
the MIB reference, or null if not found

getAllSymbols

public java.util.Collection getAllSymbols()
Returns all symbols in this MIB.

Returns:
a collection of the MIB symbols

getSymbol

public MibSymbol getSymbol(java.lang.String name)
Returns a symbol from this MIB.

Specified by:
getSymbol in interface MibContext
Parameters:
name - the symbol name
Returns:
the MIB symbol, or null if not found

getSymbolByValue

public MibValueSymbol getSymbolByValue(java.lang.String value)
Returns a value symbol from this MIB.

Parameters:
value - the symbol value
Returns:
the MIB value symbol, or null if not found

getSymbolByValue

public MibValueSymbol getSymbolByValue(MibValue value)
Returns a value symbol from this MIB.

Parameters:
value - the symbol value
Returns:
the MIB value symbol, or null if not found

toString

public java.lang.String toString()
Returns a string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this object