gov.lanl.Utility
Class NamedValues

java.lang.Object
  |
  +--gov.lanl.Utility.NamedValues

public class NamedValues
extends java.lang.Object

Provides support for extracting fields from a name pair string, such as x509 distinguised/issuer names Eg. "DN= Charlie Smith, email=charlie@abc.com" would build a hash table with (DN,Charlie Smith) and (email, charlie@abc.com) and one could search for the value associated with DN or email.

Version:
$Id: NamedValues.java,v 1.3 2002/10/02 16:48:41 jimgeorge Exp $
Author:
Jim George

Constructor Summary
NamedValues(java.util.Properties props)
          Constructor for NamedValues from a Properties sheeet
NamedValues(java.lang.String inString)
          Constructor for the NamedValues, preserving case.
NamedValues(java.lang.String inString, boolean inLowerCaseOnly)
          Constructor for the NamedValues
 
Method Summary
 java.lang.String get(java.lang.String inName)
          Find and return the value associated with the key.
 java.lang.String getLike(java.lang.String inName)
          Find and return the property associated with a key which has inName as a substring
 java.util.Properties getProperties()
          get the underlying Properties object
 java.lang.String toString()
          Convert the NamedValues to a String representation (name1 = value1, name2 = value2, ...)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NamedValues

public NamedValues(java.lang.String inString,
                   boolean inLowerCaseOnly)
Constructor for the NamedValues

Parameters:
inString - is the string to be parsed into name pairs, assuming key value pairs separated by =, commas, newlines, tabs or carriage returns. Builds a structure for querering.

NamedValues

public NamedValues(java.lang.String inString)
Constructor for the NamedValues, preserving case.

Parameters:
inString - is the string to be parsed into name pairs

NamedValues

public NamedValues(java.util.Properties props)
Constructor for NamedValues from a Properties sheeet

Parameters:
props -
Method Detail

get

public java.lang.String get(java.lang.String inName)
Find and return the value associated with the key.

Parameters:
inName - is the key whose value is wanted
Returns:
a string with the associated key's value

getLike

public java.lang.String getLike(java.lang.String inName)
Find and return the property associated with a key which has inName as a substring

Parameters:
inName - is the substring to look for in a key
Returns:
the string associated with the first key found which has the indicated substring

getProperties

public java.util.Properties getProperties()
get the underlying Properties object

Returns:

toString

public java.lang.String toString()
Convert the NamedValues to a String representation (name1 = value1, name2 = value2, ...)

Overrides:
toString in class java.lang.Object
Returns:


Copyright © 2000 Apache Software Foundation. All Rights Reserved.