diff options
Diffstat (limited to 'pki/base/common/src/com/netscape/certsrv/common/NameValuePairs.java')
-rw-r--r-- | pki/base/common/src/com/netscape/certsrv/common/NameValuePairs.java | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/pki/base/common/src/com/netscape/certsrv/common/NameValuePairs.java b/pki/base/common/src/com/netscape/certsrv/common/NameValuePairs.java index 628fc223f..678ccfee2 100644 --- a/pki/base/common/src/com/netscape/certsrv/common/NameValuePairs.java +++ b/pki/base/common/src/com/netscape/certsrv/common/NameValuePairs.java @@ -17,14 +17,17 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.common; + import java.util.Enumeration; import java.util.Hashtable; import java.util.StringTokenizer; import java.util.Vector; + /** - * A class represents an ordered list of name value pairs. - * + * A class represents an ordered list of name + * value pairs. + * * @version $Revision$, $Date$ */ public class NameValuePairs { @@ -32,19 +35,20 @@ public class NameValuePairs { private Vector mPairs = new Vector(); // an index to speed up searching - // The key is the name. The element is the NameValuePair. + // The key is the name. The element is the NameValuePair. private Hashtable index = new Hashtable(); /** * Constructs name value pairs. - */ + */ public NameValuePairs() { } /** - * Adds a name value pair into this set. if the name already exist, the - * value will be replaced. - * + * Adds a name value pair into this set. + * if the name already exist, the value will + * be replaced. + * * @param name name * @param value value */ @@ -62,7 +66,7 @@ public class NameValuePairs { /** * Retrieves name value pair from this set. - * + * * @param name name * @return name value pair */ @@ -72,7 +76,7 @@ public class NameValuePairs { /** * Returns number of pairs in this set. - * + * * @return size */ public int size() { @@ -81,7 +85,7 @@ public class NameValuePairs { /** * Retrieves name value pairs in specific position. - * + * * @param pos position of the value * @return name value pair */ @@ -98,8 +102,9 @@ public class NameValuePairs { } /** - * Retrieves value of the name value pairs that matches the given name. - * + * Retrieves value of the name value pairs that matches + * the given name. + * * @param name name * @return value */ @@ -114,25 +119,26 @@ public class NameValuePairs { /** * Retrieves a list of names. - * + * * @return a list of names */ public Enumeration getNames() { Vector v = new Vector(); - int size = mPairs.size(); + int size = mPairs.size(); - for (int i = 0; i < size; i++) { + for (int i = 0; i < size; i++) { NameValuePair p = (NameValuePair) mPairs.elementAt(i); v.addElement(p.getName()); } - // System.out.println("getNames: "+v.size()); + //System.out.println("getNames: "+v.size()); return v.elements(); } - + /** - * Show the content of this name value container as string representation. - * + * Show the content of this name value container as + * string representation. + * * @return string representation */ public String toString() { @@ -149,7 +155,7 @@ public class NameValuePairs { /** * Parses a string into name value pairs. - * + * * @param s string * @param nvp name value pairs * @return true if successful @@ -168,16 +174,16 @@ public class NameValuePairs { String v = t.substring(i + 1); nvp.add(n, v); - } + } return true; } /** * Returns a list of name value pair object. - * + * * @return name value objects */ public Enumeration elements() { return mPairs.elements(); } -} +} |