|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.greenstone.gs3client.data.Pair
public class Pair
Pair is a simple utility class to represent two associated String values. For instance, a Metadata (name, value) pair to be displayed in either SearchResultsDisplay or BrowseDisplay's metanames and metavalues JLists. (These two classes can be found in org.greenstone.gs3client.) A Comparator--like the one provided by org.greenstone.gs3client.Displays' inner class MetadataComparator--is necessary to ensure that the "natural ordering" of any List of metadata Pairs will be as required. This class does not implement Comparable so that it may be used for other purposes than storing ordered Metadata pairs, which is why using an external Comparator to provide the sorting facility is more useful.
Field Summary | |
---|---|
java.lang.String |
first
first item of the Pair |
java.lang.String |
second
second item of the Pair |
Constructor Summary | |
---|---|
Pair(java.lang.String a,
java.lang.String b)
Constructor that creates a Pair from two String values. |
Method Summary | |
---|---|
static java.lang.String[] |
getFirst(java.util.Vector pairs)
Given a Vector of Pairs, returns an array of all the first values of each Pair. |
static java.lang.String[] |
getSecond(java.util.Vector pairs)
Given a Vector of Pairs, returns an array of all the second values of each Pair. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final java.lang.String first
public final java.lang.String second
Constructor Detail |
---|
public Pair(java.lang.String a, java.lang.String b)
a
- - the value for the first item of the Pairb
- - the value for the second item of the Pair.Method Detail |
---|
public static java.lang.String[] getFirst(java.util.Vector pairs)
public static java.lang.String[] getSecond(java.util.Vector pairs)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |