|
SNMP Stack 5_1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.co.westhawk.snmp.stack.AsnObject | +--uk.co.westhawk.snmp.stack.AsnObjectId
This class represents the ASN.1 ObjectID class. An Object ID (OID) identifies a variable in a MIB.
Field Summary |
Fields inherited from class uk.co.westhawk.snmp.stack.AsnObject |
contentsLength, debug, headerLength, isCorrect, startPos, type |
Constructor Summary | |
AsnObjectId(long[] oida)
Constructs an AsnObjectId out of an array of long. |
|
AsnObjectId(java.lang.String s)
Constructs an AsnObjectId out of an OID string. |
Method Summary | |
void |
add(long sub_oid)
Adds a single sub-identifier to the end of the OID. |
void |
add(long[] sub_oid)
Adds a number of sub-identifiers to the end of the OID. |
void |
add(java.lang.String s)
Adds sub-identifiers to the end of the OID. |
boolean |
equals(java.lang.Object anObject)
Compares this OID to the specified object. |
long |
getElementAt(int index)
Returns the element in the AsnObjectId at the specified index. |
long[] |
getOid()
Returns the value of the AsnObjectId as an array of long. |
int |
getSize()
Returns the number of elements in the AsnObjectId. |
long[] |
getSubOid(int beginIndex,
int endIndex)
Returns a subset of the value of the AsnObjectId as an array of long. |
java.lang.String |
getValue()
Returns the value of the AsnObjectId. |
int |
hashCode()
Returns a hash code for this OID. |
boolean |
startsWith(AsnObjectId prefix)
Checks if this OID starts with the specified prefix. |
java.lang.String |
toString()
Returns the string representation of the AsnObjectId. |
java.lang.String |
toString(long[] v)
Returns the string representation of the AsnObjectId. |
Methods inherited from class uk.co.westhawk.snmp.stack.AsnObject |
getRespType, getRespTypeString, setDebug |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AsnObjectId(java.lang.String s) throws java.lang.IllegalArgumentException
s
- The OID, format a[.b]*public AsnObjectId(long[] oida)
oida
- The OID, as an array of longMethod Detail |
public boolean startsWith(AsnObjectId prefix)
public void add(long sub_oid)
sub_oid
- the sub-identifierpublic void add(long[] sub_oid)
sub_oid
- the sub-identifiersAsnOctets.toSubOid(boolean)
public void add(java.lang.String s) throws java.lang.IllegalArgumentException
s
- the sub-identifiers, format a[.b]*
java.lang.IllegalArgumentException
public java.lang.String getValue()
public java.lang.String toString()
toString
in class AsnObject
public java.lang.String toString(long[] v)
public int getSize()
public long getElementAt(int index) throws java.lang.ArrayIndexOutOfBoundsException
index
- the index
java.lang.ArrayIndexOutOfBoundsException
- if an invalid
index was givenpublic long[] getOid()
public long[] getSubOid(int beginIndex, int endIndex) throws java.lang.ArrayIndexOutOfBoundsException
java.lang.ArrayIndexOutOfBoundsException
SnmpUtilities.longToByte(long[])
public boolean equals(java.lang.Object anObject)
true
if and only if the argument is not
null
and is a AsnObjectId
object that represents
the same sequence of numbers as this object.
Thanks to Eli Bishop (eli@graphesthesia.com) for the suggestion of adding it.
equals
in class java.lang.Object
anObject
- the object to compare this AsnObjectId
against.
true
if the AsnObjectId
are equal;
false
otherwise.public int hashCode()
hashCode
in class java.lang.Object
|
SNMP Stack 5_1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |