JASMI API

com.agentpp.smi
Interface IObjectID


public interface IObjectID

SMIObjectID represents a SMI object identifier which is a string of the format [[.]...] where is a (long) number from 0 to 4294967295.

Version:
1.8.1
Author:
Frank Fock

Method Summary
 java.lang.String getLastSubIdentifier()
          Gets the last sub-identifier of this OID.
 long[] getLongArray()
          Return the sub IDs of the Object ID as a long array.
 java.lang.String getSubID(int n)
          Gets the nth sub-identifier.
 java.util.List getSubIdentifiers()
          Gets the List of sub-identifiers of this OID as String objects.
 boolean isChildOf(IObjectID id)
          Check whether the receiver is a child of a given IObjectID.
 boolean isDescendantOf(IObjectID id, int level)
          Check whether the receiver is a descendant of a given oid and level.
 boolean isEmpty()
          Check whether the receiver is empty (has zero length).
 boolean isLessThan(IObjectID oid)
          Check whether the receiver is lexicographically less than a given IObjectID.
 boolean isParentOf(IObjectID id)
          Check whether the receiver is parent of a given oid, thus starts with the same prefix but has exactly one subidentifier less than the given oid.
 boolean isRootOf(IObjectID id)
          Check whether the receiver is root of a given oid, thus starts with the same prefix.
 boolean isValid()
          Checks whether this OID is a valid numeric dotted string OID.
 int size()
          Returns the size of the OID (i.e., the number of its subidentifiers).
 java.lang.String toString()
          Return the OID as a dotted String.
 IObjectID trim()
          Returns a copy of this IObjectID instance without its last subidentifier.
 

Method Detail

getLongArray

long[] getLongArray()
Return the sub IDs of the Object ID as a long array.

Returns:
an array of long.

getSubIdentifiers

java.util.List getSubIdentifiers()
Gets the List of sub-identifiers of this OID as String objects.

Returns:
a List of Strings.

getLastSubIdentifier

java.lang.String getLastSubIdentifier()
Gets the last sub-identifier of this OID.

Returns:
the last sub-identifier or null if the size() of this OID is zero.

getSubID

java.lang.String getSubID(int n)
Gets the nth sub-identifier.

Parameters:
n - the index of the sub-identifier to return, where 0 denotes the first.
Returns:
a String containing the nth sub-identifier of this OID or null if n less 0 or n is greater or equal to the length of this OID.

size

int size()
Returns the size of the OID (i.e., the number of its subidentifiers).

Returns:
a unsigned integer denoting the length of the OID.

toString

java.lang.String toString()
Return the OID as a dotted String.

Overrides:
toString in class java.lang.Object
Returns:
a String with the format [[.]...] where is a (long) number from 0 to 4294967295.

isLessThan

boolean isLessThan(IObjectID oid)
Check whether the receiver is lexicographically less than a given IObjectID. Both IObjectIDs must be valid.

Parameters:
oid - a IObjectID
Returns:
true if the receiver is less than oid.

isEmpty

boolean isEmpty()
Check whether the receiver is empty (has zero length).

Returns:
true if the receiver does not contain any subidentifier.

isParentOf

boolean isParentOf(IObjectID id)
Check whether the receiver is parent of a given oid, thus starts with the same prefix but has exactly one subidentifier less than the given oid.

Parameters:
id - an object identifier.
Returns:
true if the receiver is parent of id.

isRootOf

boolean isRootOf(IObjectID id)
Check whether the receiver is root of a given oid, thus starts with the same prefix.

Parameters:
id - an object identifier.
Returns:
true if the receiver is root of id.

isDescendantOf

boolean isDescendantOf(IObjectID id,
                       int level)
Check whether the receiver is a descendant of a given oid and level. A descendand of level 1 would be a child.

Parameters:
id - an object identifier.
level - determines how many nodes (less one) have to be between the receiver and id on the path to the root.
Returns:
true if the receiver is a descendant of id with level nodes less one inbetween.

isChildOf

boolean isChildOf(IObjectID id)
Check whether the receiver is a child of a given IObjectID.

Parameters:
id - an object identifier.
Returns:
true if the receiver is a child of id.

trim

IObjectID trim()
Returns a copy of this IObjectID instance without its last subidentifier.

Returns:
an IObjectID instance whose size is n-1 if n is the size of this OID and n > 0. If n is zero, then the size of the returned OID will be also zero.

isValid

boolean isValid()
Checks whether this OID is a valid numeric dotted string OID.

Returns:
true if this OID containes only digits and the dot ('.') characters.

JASMI API

JASMI 3
Copyright 2001-2010 Frank Fock
All Rights Reserved