byucc.edif
Class NamedObjectCompare

java.lang.Object
  extended bybyucc.edif.NamedObjectCompare
All Implemented Interfaces:
java.util.Comparator, java.io.Serializable

public class NamedObjectCompare
extends java.lang.Object
implements java.util.Comparator, java.io.Serializable

Compares NamedObject objects.

Version:
$Id: NamedObjectCompare.java,v 1.10 2004/08/27 19:16:42 tsa6 Exp $
Author:
Mike Wirthlin, Welson Sun, Tyler Anderson
See Also:
NamedObject, Serialized Form

Field Summary
static boolean CASE_SENSITIVE
          Variable specifying whether string compares should be case sensitive or not.
private static java.lang.String s1
          The two strings initialized, and then used for comparison by methods in this class.
private static java.lang.String s2
          The two strings initialized, and then used for comparison by methods in this class.
 
Constructor Summary
NamedObjectCompare()
           
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Compares two Objects by their String name.
static boolean equals(java.lang.Object o1, java.lang.Object o2)
          Compares two Objects by their String name.
private static void getStrings(java.lang.Object o1, java.lang.Object o2)
          Initializes the two strings used for comparison by the methods in this class.
static boolean startsWith(java.lang.Object o1, java.lang.Object o2)
          Compares string o2 with the beginning of o2.
 
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
 

Field Detail

CASE_SENSITIVE

public static boolean CASE_SENSITIVE
Variable specifying whether string compares should be case sensitive or not.


s1

private static java.lang.String s1
The two strings initialized, and then used for comparison by methods in this class.


s2

private static java.lang.String s2
The two strings initialized, and then used for comparison by methods in this class.

Constructor Detail

NamedObjectCompare

public NamedObjectCompare()
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Compares two Objects by their String name.

Specified by:
compare in interface java.util.Comparator
Parameters:
o1 - The first Object for comparison
o2 - The second Object for comparison
Returns:
An int value which specifies the result of the String comparison

equals

public static boolean equals(java.lang.Object o1,
                             java.lang.Object o2)
Compares two Objects by their String name.

Parameters:
o1 - The first Object for comparison
o2 - The second Object for comparison
Returns:
True if o1 equals o2

getStrings

private static void getStrings(java.lang.Object o1,
                               java.lang.Object o2)
Initializes the two strings used for comparison by the methods in this class.

Parameters:
o1 - The first Object for comparison
o2 - The second Object for comparison

startsWith

public static boolean startsWith(java.lang.Object o1,
                                 java.lang.Object o2)
Compares string o2 with the beginning of o2.

Parameters:
o1 - The first Object for comparison
o2 - The second Object for comparison
Returns:
True if o1 starts with o2