eu.xtreemos.xosd.localallocmgr.attributes.handlers
Class CurrentAmountHandler

java.lang.Object
  extended by eu.xtreemos.xosd.localallocmgr.attributes.handlers.CurrentAmountHandler
All Implemented Interfaces:
IAttributeHandler

public class CurrentAmountHandler
extends java.lang.Object
implements IAttributeHandler

operations needed for interval management for the current amount attribute.

Author:
uros

Constructor Summary
CurrentAmountHandler()
           
 
Method Summary
 boolean add(IAttribute<?> op1, IAttribute<?> op2)
          note that addition as always possible, the value of op1 is added to the value of op2.
 boolean canAdd(IAttribute<?> op1, IAttribute<?> op2)
           
 boolean canDelay(IAttribute<?> op1, IAttribute<?> op2)
           
 boolean canRemove(IAttribute<?> op1, IAttribute<?> op2)
           
 boolean delay(IAttribute<?> op1, IAttribute<?> op2)
           
 boolean remove(IAttribute<?> op1, IAttribute<?> op2)
          substracts the value of op1 from op2, the new value stored in op2.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CurrentAmountHandler

public CurrentAmountHandler()
Method Detail

add

public boolean add(IAttribute<?> op1,
                   IAttribute<?> op2)
note that addition as always possible, the value of op1 is added to the value of op2. NOTE: if there is a MaxValue set by the resource and is disregarded by the selection methods, the combined value can be greater than the max defined.

Specified by:
add in interface IAttributeHandler

canAdd

public boolean canAdd(IAttribute<?> op1,
                      IAttribute<?> op2)
Specified by:
canAdd in interface IAttributeHandler

canDelay

public boolean canDelay(IAttribute<?> op1,
                        IAttribute<?> op2)
Specified by:
canDelay in interface IAttributeHandler

canRemove

public boolean canRemove(IAttribute<?> op1,
                         IAttribute<?> op2)
Specified by:
canRemove in interface IAttributeHandler

delay

public boolean delay(IAttribute<?> op1,
                     IAttribute<?> op2)
Specified by:
delay in interface IAttributeHandler

remove

public boolean remove(IAttribute<?> op1,
                      IAttribute<?> op2)
substracts the value of op1 from op2, the new value stored in op2. Note that the minimum value is 0.

Specified by:
remove in interface IAttributeHandler