bibliothek.gui.dock.station.support
Enum Enforcement

java.lang.Object
  extended by java.lang.Enum<Enforcement>
      extended by bibliothek.gui.dock.station.support.Enforcement
All Implemented Interfaces:
Serializable, Comparable<Enforcement>

public enum Enforcement
extends Enum<Enforcement>

Describes how much a caller to Combiner.prepare(CombinerSource, Enforcement) would like the method to succeed.

Author:
Benjamin Sigg

Enum Constant Summary
EXPECTED
          The caller of prepare does have a backup plan should the method return null, but it is not a good one.
FREE
          It is completely up to the Combiner whether prepare returns null or not.
HARD
          prepare must return a value that is not null.
WHISHED
          The caller of prepare does have a backup plan should the method return null, and it is a good one.
 
Method Summary
 float getForce()
          Gets the force on a scale of 0 to 1, where 0 means that prepare is free to do what it wants, while 1 means that prepare must not return a null value.
static Enforcement valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Enforcement[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

HARD

public static final Enforcement HARD
prepare must return a value that is not null.


EXPECTED

public static final Enforcement EXPECTED
The caller of prepare does have a backup plan should the method return null, but it is not a good one.


WHISHED

public static final Enforcement WHISHED
The caller of prepare does have a backup plan should the method return null, and it is a good one.


FREE

public static final Enforcement FREE
It is completely up to the Combiner whether prepare returns null or not.

Method Detail

values

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

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

valueOf

public static Enforcement valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name

getForce

public float getForce()
Gets the force on a scale of 0 to 1, where 0 means that prepare is free to do what it wants, while 1 means that prepare must not return a null value.

Returns:
the force of the request