org.xbill.DNS.utils
Class StringValueTable

java.lang.Object
  extended byorg.xbill.DNS.utils.StringValueTable

public class StringValueTable
extends Object

A table used for storing mappings between Strings and constant values and lookups in either direction.

Author:
Brian Wellington

Constructor Summary
StringValueTable()
           
 
Method Summary
 String getString(int v)
          Finds the String associated with the given value
 int getValue(String s)
          Finds the value associated with the given String
 void put2(int v, String s)
          Adds a new String/value pair
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringValueTable

public StringValueTable()
Method Detail

put2

public void put2(int v,
                 String s)
Adds a new String/value pair

Parameters:
v - The value
s - The string

getString

public String getString(int v)
Finds the String associated with the given value

Parameters:
v - The value
Returns:
The corresponding String, or null if there is none

getValue

public int getValue(String s)
Finds the value associated with the given String

Parameters:
s - The String
Returns:
The corresponding value, or -1 if there is none