2.17.2: 2011-06-17

net.sf.basedb.core
Enum BioWell.LockMode

java.lang.Object
  extended by java.lang.Enum<BioWell.LockMode>
      extended by net.sf.basedb.core.BioWell.LockMode
All Implemented Interfaces:
Serializable, Comparable<BioWell.LockMode>
Enclosing class:
BioWell

public static enum BioWell.LockMode
extends Enum<BioWell.LockMode>

The lock mode for a well is determined by the plate's bio plate type. See BioPlateType.getLockMode(). The lock-mode is used to determine if the well can be assigned to a biomaterial or not.

Since:
2.16

Enum Constant Summary
LOCKED_AFTER_ADD
          It is allowed to add biomaterial once to the well.
LOCKED_AFTER_CREATE
          It is allowed to add biomaterial once to the well, but it most be done at the same time the plate is creted.
LOCKED_AFTER_MOVE
          It is allowed to add biomaterial once to the well.
UNLOCKED
          The well is not locked.
 
Field Summary
private  String displayValue
           
private  int value
          The integer value of this lock mode.
private static Map<Integer,BioWell.LockMode> valueMapping
          Maps an integer to a lock mode.
 
Method Summary
 boolean canAdd(BioWell well)
          Is it allowed to add (a different) biomaterial to the well?
(package private) abstract  boolean canAdd(BioWellData well)
           
 boolean canClear(BioWell well)
          Is it allowed to clear a well from biomaterial?
(package private) abstract  boolean canClear(BioWellData well)
           
static BioWell.LockMode fromValue(int value)
          Get the Lock mode object when you know the integer code.
 int getValue()
          Get the integer value that is used when storing a lock mode to the database.
(package private)  void onAdd(BioWellData well, MeasuredBioMaterialData biomaterial)
          Called when biomaterial is added to a well.
(package private)  void onClear(BioWellData well, MeasuredBioMaterialData biomaterial)
          Called when a well is cleared from an existing biomaterial.
 String toString()
           
static BioWell.LockMode valueOf(String name)
          Returns the enum constant of this type with the specified name.
static BioWell.LockMode[] 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, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

UNLOCKED

public static final BioWell.LockMode UNLOCKED
The well is not locked. It is possible to change the biomaterial any number of times.


LOCKED_AFTER_MOVE

public static final BioWell.LockMode LOCKED_AFTER_MOVE
It is allowed to add biomaterial once to the well. It can not be replaced by a new biomaterial but it is possible to clear it. The original biomaterial is then saved in the BioWell.getOriginalBioMaterial().


LOCKED_AFTER_ADD

public static final BioWell.LockMode LOCKED_AFTER_ADD
It is allowed to add biomaterial once to the well. It can't be replaced by a new biomaterial and it is not possible to clear it. It is possible to add biomaterial to empty wells at any time.


LOCKED_AFTER_CREATE

public static final BioWell.LockMode LOCKED_AFTER_CREATE
It is allowed to add biomaterial once to the well, but it most be done at the same time the plate is creted. Once the transaction has been committed to the database, all wells become locked.

Field Detail

valueMapping

private static final Map<Integer,BioWell.LockMode> valueMapping
Maps an integer to a lock mode.


value

private final int value
The integer value of this lock mode.


displayValue

private final String displayValue
Method Detail

values

public static BioWell.LockMode[] 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 (BioWell.LockMode c : BioWell.LockMode.values())
    System.out.println(c);

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

valueOf

public static BioWell.LockMode 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
NullPointerException - if the argument is null

toString

public String toString()
Overrides:
toString in class Enum<BioWell.LockMode>

getValue

public int getValue()
Get the integer value that is used when storing a lock mode to the database.

Returns:
The integer value for this lock mode

fromValue

public static BioWell.LockMode fromValue(int value)
Get the Lock mode object when you know the integer code.

Parameters:
value - The integer value
Returns:
The location for the integer value

canClear

public boolean canClear(BioWell well)
Is it allowed to clear a well from biomaterial? This method should return true for an empty well.

Parameters:
well - The biowell to check

canClear

abstract boolean canClear(BioWellData well)

onClear

void onClear(BioWellData well,
             MeasuredBioMaterialData biomaterial)
Called when a well is cleared from an existing biomaterial. The default implementation of this method does nothing, but it may be overriden by some lock modes.

Parameters:
well - The well that is cleared
biomaterial - The biomaterial that is currently located on the well

canAdd

public boolean canAdd(BioWell well)
Is it allowed to add (a different) biomaterial to the well? If this method is called for a non-empty well, the check must assume that the well is first cleared.

Parameters:
well - A biowell
See Also:
BioWell.canAddBioMaterial()

canAdd

abstract boolean canAdd(BioWellData well)

onAdd

void onAdd(BioWellData well,
           MeasuredBioMaterialData biomaterial)
Called when biomaterial is added to a well. The default implementation of this method does nothing, but it may be overriden by some lock modes.

Parameters:
well - The well the biomaterial is added to
biomaterial - The biomaterial that is going to be added to the well

2.17.2: 2011-06-17