FileDocCategorySizeDatePackage
Collate2.javaAPI DocExample1506Sat Sep 12 03:01:00 BST 1998None

Collate2

public class Collate2 extends Object
Comparison of CollationKeys.
see
com.objectspace.jgl.predicates.LessCollationKey
see
com.objectspace.jgl.predicates.LessEqualCollationKey
see
com.objectspace.jgl.predicates.GreaterCollationKey
see
com.objectspace.jgl.predicates.GreaterEqualCollationKey
see
java.text.Collator
see
java.text.CollationKey
version
3.0.0
author
ObjectSpace, Inc.

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

    Collator collator = Collator.getInstance();
    show( "default collating", collator );

    collator.setStrength( Collator.PRIMARY );
    show( "case insensitive", collator );
    
public static voidshow(java.lang.String tag, java.text.Collator collator)

    // allow duplicates in set
    OrderedSet set = new OrderedSet( new LessCollationKey(), true );

    // add a few entries
    set.add( collator.getCollationKey( "Texas" ) );
    set.add( collator.getCollationKey( "texas" ) );
    set.add( collator.getCollationKey( "Texas Fight" ) );

    // print the resulting container
    System.out.println( tag );
    Enumeration iterator = set.begin();
    while ( iterator.hasMoreElements() )
      System.out.println( "\t" + ( (CollationKey)iterator.nextElement() ).getSourceString() );