summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/certsrv/common/NameValuePairs.java
diff options
context:
space:
mode:
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.java52
1 files changed, 23 insertions, 29 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 678ccfee..628fc223 100644
--- a/pki/base/common/src/com/netscape/certsrv/common/NameValuePairs.java
+++ b/pki/base/common/src/com/netscape/certsrv/common/NameValuePairs.java
@@ -17,17 +17,14 @@
// --- 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 {
@@ -35,20 +32,19 @@ 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
*/
@@ -66,7 +62,7 @@ public class NameValuePairs {
/**
* Retrieves name value pair from this set.
- *
+ *
* @param name name
* @return name value pair
*/
@@ -76,7 +72,7 @@ public class NameValuePairs {
/**
* Returns number of pairs in this set.
- *
+ *
* @return size
*/
public int size() {
@@ -85,7 +81,7 @@ public class NameValuePairs {
/**
* Retrieves name value pairs in specific position.
- *
+ *
* @param pos position of the value
* @return name value pair
*/
@@ -102,9 +98,8 @@ 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
*/
@@ -119,26 +114,25 @@ 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() {
@@ -155,7 +149,7 @@ public class NameValuePairs {
/**
* Parses a string into name value pairs.
- *
+ *
* @param s string
* @param nvp name value pairs
* @return true if successful
@@ -174,16 +168,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();
}
-}
+}