ProgramixGenericLib v5.0.1

com.programix.collections
Class GeneralStringComparator.NullTreatment

java.lang.Object
  extended by com.programix.collections.GeneralStringComparator.NullTreatment
Enclosing class:
GeneralStringComparator

public static final class GeneralStringComparator.NullTreatment
extends Object

Defines how null references should be treated when being compared to String's.

Author:
Paul Hyde

Field Summary
static GeneralStringComparator.NullTreatment GREATER_THAN_ALL
          When a null reference is found, treat it as if it is greater than all other strings.
static GeneralStringComparator.NullTreatment LESS_THAN_ALL
          When a null reference is found, treat it as if it is less than all other strings.
static GeneralStringComparator.NullTreatment ZERO_LENGTH_STRING
          When a null reference is found, treat it as if it was a zero-length string.
 
Method Summary
 boolean equals(Object obj)
          Use this method instead of == to be sure that serialization or multiple class loaders have not resulted in multiple instances.
 String getName()
           
static GeneralStringComparator.NullTreatment[] getValues()
          Returns an array of all the legal values.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ZERO_LENGTH_STRING

public static final GeneralStringComparator.NullTreatment ZERO_LENGTH_STRING
When a null reference is found, treat it as if it was a zero-length string.


LESS_THAN_ALL

public static final GeneralStringComparator.NullTreatment LESS_THAN_ALL
When a null reference is found, treat it as if it is less than all other strings. This does not apply to comparing null to null as they are considered to be equal to each other.


GREATER_THAN_ALL

public static final GeneralStringComparator.NullTreatment GREATER_THAN_ALL
When a null reference is found, treat it as if it is greater than all other strings. This does not apply to comparing null to null as they are considered to be equal to each other.

Method Detail

getName

public String getName()

equals

public boolean equals(Object obj)
Use this method instead of == to be sure that serialization or multiple class loaders have not resulted in multiple instances.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

getValues

public static GeneralStringComparator.NullTreatment[] getValues()
Returns an array of all the legal values. A cloned copy is returned, so no caution is required.


ProgramixGenericLib v5.0.1

Copyright © 2001-2009 Programix Incorporated. All rights reserved. ProgramixGenericLib is free and is OSI Certified Open Source Software under the BSD license.