org.greenstone.gs3client
Class Displays.MetadataComparator

java.lang.Object
  extended by org.greenstone.gs3client.Displays.MetadataComparator
All Implemented Interfaces:
java.util.Comparator
Enclosing class:
Displays

public static class Displays.MetadataComparator
extends java.lang.Object
implements java.util.Comparator

Static inner class MetadataComparator is a Comparator for the metadata fields stored as a list of Pair objects (name, values). We want to display them alphabetised, grouped by prefix (dls.title, dls.x; dc.title; dc.creator; greenstone's ex metadata does not have a prefix) and in order of alphabet BUT all those starting with capital letters come first, then come those starting with lowercase letters. Those with prefixes come first of all. Comparators can be passed to a sort method (such as Collections.sort) to allow precise control over the sort order. Comparators can also be used to control the order of certain data structures (such as TreeSet or TreeMap).

See Also:
Comparator class

Constructor Summary
Displays.MetadataComparator()
           
 
Method Summary
 int compare(java.lang.Object nodeID1, java.lang.Object nodeID2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

Displays.MetadataComparator

public Displays.MetadataComparator()
Method Detail

compare

public int compare(java.lang.Object nodeID1,
                   java.lang.Object nodeID2)
Specified by:
compare in interface java.util.Comparator