Class StringComparator

java.lang.Object
uk.ac.starlink.datanode.nodes.StringComparator
All Implemented Interfaces:
Comparator

public class StringComparator extends Object implements Comparator
A very simple implementation of the Comparator interface. It is suitable for use on any objects for which the toString method provides a suitable basis for object comparison.

You might think that calling java.text.Collator.getInstance ought to provide much the same thing; however that gives you a compare method which casts to String rather than calling the toString method on its arguments, leading to a ClassCastException in most useful cases. I wonder why it does that?

Version:
$Id$
Author:
Mark Taylor (Starlink)