com.miginfocom.property
Enum FirePolicy

java.lang.Object
  extended by java.lang.Enum<FirePolicy>
      extended by com.miginfocom.property.FirePolicy
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<FirePolicy>

public enum FirePolicy
extends java.lang.Enum<FirePolicy>

How the old and new property value should be compared and thus how to detect if an event change should be fired.


Enum Constant Summary
ALWAYS
          It will always fire and no comparison is made.
NOT_EQUALS
          The event will fire if the old and new value are not equals.
NOT_SAME
          The event will fire if the old and new value are not the same object
 
Method Summary
 boolean shouldFire(java.lang.Object o1, java.lang.Object o2)
          Compares the two objects depending on the value of this.
static FirePolicy valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static FirePolicy[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NOT_EQUALS

public static final FirePolicy NOT_EQUALS
The event will fire if the old and new value are not equals.


NOT_SAME

public static final FirePolicy NOT_SAME
The event will fire if the old and new value are not the same object


ALWAYS

public static final FirePolicy ALWAYS
It will always fire and no comparison is made.

Method Detail

values

public static FirePolicy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (FirePolicy c : FirePolicy.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static FirePolicy valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

shouldFire

public final boolean shouldFire(java.lang.Object o1,
                                java.lang.Object o2)
Compares the two objects depending on the value of this.

Parameters:
o1 - The first object. Normally the "old" property value.
o2 - The second object. Normally the "new" property value.
Returns:
If the two objects are considederd equal.


Copyright © 2007 MiG InfoCom AB. All Rights Reserved.