org.quartz.locality.constraint
Class MemoryConstraint

java.lang.Object
  extended by org.quartz.locality.constraint.MemoryConstraint
All Implemented Interfaces:
Serializable, Constraint<MemoryConstraint.Operator,Long>

public class MemoryConstraint
extends Object
implements Constraint<MemoryConstraint.Operator,Long>

Constraint on memory characteristics of the node to execute the Job on

Author:
Alex Snaps
See Also:
MemoryEvaluator, Serialized Form

Nested Class Summary
static class MemoryConstraint.Operator
           
static class MemoryConstraint.Unit
          Memory units
 
Constructor Summary
MemoryConstraint(MemoryConstraint.Operator op, long value)
          MemoryConstraint constructor
 
Method Summary
static MemoryConstraint atLeastAvailable(int amount, MemoryConstraint.Unit unit)
          Creates a MemoryConstraint for at least an amount of memory available
 boolean equals(Object obj)
           
 MemoryConstraint.Operator getOp()
          Getter to operator
 int hashCode()
           
 boolean matches(Long actual)
          
static MemoryConstraint orderDescending()
          Returns a MemoryConstraint to sort the nodes by memory available
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryConstraint

public MemoryConstraint(MemoryConstraint.Operator op,
                        long value)
MemoryConstraint constructor

Parameters:
op - Operation to validate against
value - Target value
Method Detail

matches

public boolean matches(Long actual)


getOp

public MemoryConstraint.Operator getOp()
Getter to operator

Returns:
Operator

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

atLeastAvailable

public static MemoryConstraint atLeastAvailable(int amount,
                                                MemoryConstraint.Unit unit)
Creates a MemoryConstraint for at least an amount of memory available

Parameters:
amount - minimum amount
unit - Memory unit
Returns:
The MemoryConstraint instance

orderDescending

public static MemoryConstraint orderDescending()
Returns a MemoryConstraint to sort the nodes by memory available

Returns:
The MemoryConstraint instance


Copyright 2001-2013, Terracotta, Inc.