wt.inf.container
Class PropertyComparator

java.lang.Object
  extended bywt.inf.container.PropertyComparator
All Implemented Interfaces:
Comparator, Serializable

public final class PropertyComparator
extends Object
implements Comparator, Serializable

A utility class that can be used to compare two instances of a class by comparing the instances values of a Comparable property of the class.

Supported API: false

Extendable: false

See Also:
Comparable, Serialized Form

Field Summary
private static String CLASSNAME
           
private  PropertyDescriptor comparableProperty
           
static String DEFAULT_PROPERTY_NAME
          

Supported API: false
private static String RESOURCE
           
 
Constructor Summary
PropertyComparator()
          

Supported API: false
PropertyComparator(Class target_class)
          

Supported API: false
PropertyComparator(Class target_class, String property_name)
          

Supported API: false
 
Method Summary
private  void comparablePropertyValidate(PropertyDescriptor a_ComparableProperty)
           
 int compare(Object o1, Object o2)
          Compares the two object's values of the comparableProperty

Supported API: false
 PropertyDescriptor getComparableProperty()
          Gets the value of the attribute: comparableProperty; Comparable must be assignable from the property type.
 void setComparableProperty(Class target_class)
          Sets the property to the class's "name" property.
 void setComparableProperty(Class target_class, String property_name)
          

Supported API: false
 void setComparableProperty(PropertyDescriptor a_ComparableProperty)
          Sets the value of the attribute: comparableProperty; Comparable must be assignable from the property type.
 
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

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

DEFAULT_PROPERTY_NAME

public static final String DEFAULT_PROPERTY_NAME


Supported API: false

See Also:
Constant Field Values

comparableProperty

private PropertyDescriptor comparableProperty
Constructor Detail

PropertyComparator

public PropertyComparator()


Supported API: false


PropertyComparator

public PropertyComparator(Class target_class)
                   throws WTException


Supported API: false

Parameters:
target_class -
Throws:
WTException

PropertyComparator

public PropertyComparator(Class target_class,
                          String property_name)
                   throws WTException


Supported API: false

Parameters:
target_class -
property_name -
Throws:
WTException
Method Detail

getComparableProperty

public PropertyDescriptor getComparableProperty()
Gets the value of the attribute: comparableProperty; Comparable must be assignable from the property type.

Supported API: false

Returns:
PropertyDescriptor

setComparableProperty

public void setComparableProperty(PropertyDescriptor a_ComparableProperty)
                           throws WTPropertyVetoException
Sets the value of the attribute: comparableProperty; Comparable must be assignable from the property type.

Supported API: false

Parameters:
a_ComparableProperty -
Throws:
WTPropertyVetoException

comparablePropertyValidate

private void comparablePropertyValidate(PropertyDescriptor a_ComparableProperty)
                                 throws WTPropertyVetoException
Parameters:
a_ComparableProperty -
Throws:
WTPropertyVetoException

compare

public int compare(Object o1,
                   Object o2)
Compares the two object's values of the comparableProperty

Supported API: false

Specified by:
compare in interface Comparator
Parameters:
o1 -
o2 -
Returns:
int

setComparableProperty

public void setComparableProperty(Class target_class)
                           throws WTPropertyVetoException
Sets the property to the class's "name" property.

Supported API: false

Parameters:
target_class -
Throws:
WTPropertyVetoException

setComparableProperty

public void setComparableProperty(Class target_class,
                                  String property_name)
                           throws WTPropertyVetoException


Supported API: false

Parameters:
target_class -
property_name -
Throws:
WTPropertyVetoException