dog.gui
Class ItemCollator

java.lang.Object
  |
  +--java.text.Collator
        |
        +--dog.util.ObjectCollator
              |
              +--dog.gui.ItemCollator
All Implemented Interfaces:
java.lang.Cloneable, java.util.Comparator

public class ItemCollator
extends ObjectCollator

A class for comparing items in a list.


Fields inherited from class dog.util.ObjectCollator
collator, descending
 
Fields inherited from class java.text.Collator
CANONICAL_DECOMPOSITION, FULL_DECOMPOSITION, IDENTICAL, NO_DECOMPOSITION, PRIMARY, SECONDARY, TERTIARY
 
Constructor Summary
ItemCollator()
          Creates an item collator with the default locale.
ItemCollator(java.util.Locale locale)
          Creates an item collator with the specified locale.
 
Method Summary
 int compare(java.lang.Object source, java.lang.Object target)
          Compares two objects to one another.
 java.lang.String[] getIndices()
          Returns the indices on which items are compared with this collator.
 boolean[] getIndicesDescending()
          Returns the sort directions for the indices on which items are compared with this collator.
protected  java.lang.StringBuffer paramString()
           
 void setIndices(java.lang.String[] indices, boolean[] indicesDescending)
          Sets the indices on which items are compared with this collator.
 
Methods inherited from class dog.util.ObjectCollator
applyDescending, compare, equals, equals, getCollationKey, getDecomposition, getStrength, hashCode, isDescending, setDecomposition, setDescending, setStrength, toString
 
Methods inherited from class java.text.Collator
clone, getAvailableLocales, getInstance, getInstance
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ItemCollator

public ItemCollator()
Creates an item collator with the default locale.

ItemCollator

public ItemCollator(java.util.Locale locale)
Creates an item collator with the specified locale.
Parameters:
locale - the locale
Method Detail

getIndices

public java.lang.String[] getIndices()
Returns the indices on which items are compared with this collator.

getIndicesDescending

public boolean[] getIndicesDescending()
Returns the sort directions for the indices on which items are compared with this collator.

setIndices

public void setIndices(java.lang.String[] indices,
                       boolean[] indicesDescending)
Sets the indices on which items are compared with this collator.
Parameters:
indices - the indices
indicesDescending - the sort directions of the indices

compare

public int compare(java.lang.Object source,
                   java.lang.Object target)
Compares two objects to one another. If the objects are items, they are compared with the indices set for this ItemCollator.
Overrides:
compare in class ObjectCollator
Parameters:
source - the source item
target - the target item

paramString

protected java.lang.StringBuffer paramString()
Overrides:
paramString in class ObjectCollator