org.snmp4j.util
Class SimpleOIDTextFormat

java.lang.Object
  extended by org.snmp4j.util.SimpleOIDTextFormat
All Implemented Interfaces:
OIDTextFormat

public class SimpleOIDTextFormat
extends java.lang.Object
implements OIDTextFormat

The SimpleOIDTextFormat implements a simple textual representation for object IDs as dotted string.

Since:
1.10
Version:
1.10
Author:
Frank Fock

Constructor Summary
SimpleOIDTextFormat()
          Creates a simple OID text format.
 
Method Summary
 java.lang.String format(int[] value)
          Returns a textual representation of a raw object ID as dotted string ("1.3.6.1.4").
 int[] parse(java.lang.String text)
          Parses a textual representation of an object ID as dotted string (e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleOIDTextFormat

public SimpleOIDTextFormat()
Creates a simple OID text format.

Method Detail

format

public java.lang.String format(int[] value)
Returns a textual representation of a raw object ID as dotted string ("1.3.6.1.4").

Specified by:
format in interface OIDTextFormat
Parameters:
value - the OID value to format.
Returns:
the textual representation.

parse

public int[] parse(java.lang.String text)
            throws java.text.ParseException
Parses a textual representation of an object ID as dotted string (e.g. "1.3.6.1.2.1.1") and returns its raw value.

Specified by:
parse in interface OIDTextFormat
Parameters:
text - a textual representation of an OID.
Returns:
the raw OID value.
Throws:
java.text.ParseException - if the OID cannot be parsed successfully.

Copyright 2005-2010 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.