uk.ac.soton.itinnovation.grid.service.sla
Class UsageSummaryElement

java.lang.Object
  extended by uk.ac.soton.itinnovation.grid.service.sla.UsageSummaryElement
All Implemented Interfaces:
Cloneable

public class UsageSummaryElement
extends Object
implements Cloneable

This represents the usage and rate at an instant in time.


Constructor Summary
UsageSummaryElement()
           
UsageSummaryElement(Calendar dateTime, double rate, double usage)
           
UsageSummaryElement(Date dateTime, double rate, double usage)
           
UsageSummaryElement(UsageSummary us, long instant)
           
UsageSummaryElement(UsageSummary us, long instant, double rate, double usage)
           
 
Method Summary
 void accumulateInstantUsage(double deltaUsage)
          Use this to keep up to date the accumulated instant usage.
 void addInstantUsage(double deltaUsage)
          This adds some instant usage from an InstantaneousUsageReport to the total instant usage from such reports at this instant.
 Object clone()
           
 boolean equals(Object obj)
          Check if this object is equal to another object.
 boolean equalsByValue(Object obj)
           
 double getAccumulatedInstantUsage()
           
 Date getDateTime()
           
 Long getId()
           
 long getInstant()
           
 double getInstantUsage()
           
 long getNextElementId()
           
 double getRate()
           
 Calendar getTime()
           
 double getUsage()
           
 UsageSummary getUsageSummary()
           
 double getUsge()
           
 int hashCode()
          Calculate the hash code for this object.
 void setAccumulatedInstantUsage(double accumulatedInstantUsage)
           
 void setDateTime(Date dateTime)
           
 void setId(Long id)
           
 void setInstant(long instant)
           
 void setInstantUsage(double instantUsage)
           
 void setNextElementId(long nextElementInstant)
           
 void setRate(double argRate)
           
 void setTime(Calendar argTime)
           
 void setUsage(double argUsage)
           
 void setUsageSummary(UsageSummary usageSummary)
           
 void setUsge(double argUsage)
           
 String toString()
          
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UsageSummaryElement

public UsageSummaryElement()

UsageSummaryElement

public UsageSummaryElement(UsageSummary us,
                           long instant)

UsageSummaryElement

public UsageSummaryElement(UsageSummary us,
                           long instant,
                           double rate,
                           double usage)

UsageSummaryElement

public UsageSummaryElement(Calendar dateTime,
                           double rate,
                           double usage)

UsageSummaryElement

public UsageSummaryElement(Date dateTime,
                           double rate,
                           double usage)
Method Detail

setId

public void setId(Long id)

getId

public Long getId()

getUsageSummary

public UsageSummary getUsageSummary()

setUsageSummary

public void setUsageSummary(UsageSummary usageSummary)

getInstant

public long getInstant()

setInstant

public void setInstant(long instant)

getDateTime

public Date getDateTime()

setDateTime

public void setDateTime(Date dateTime)

getTime

public Calendar getTime()

setTime

public void setTime(Calendar argTime)

getUsge

public double getUsge()

setUsge

public void setUsge(double argUsage)

getUsage

public double getUsage()

setUsage

public void setUsage(double argUsage)

getRate

public double getRate()

setRate

public void setRate(double argRate)

getInstantUsage

public double getInstantUsage()

setInstantUsage

public void setInstantUsage(double instantUsage)

addInstantUsage

public void addInstantUsage(double deltaUsage)
This adds some instant usage from an InstantaneousUsageReport to the total instant usage from such reports at this instant. Note that this is different from accumulating usage which includes instant usage at previous reports.

Parameters:
deltaUsage -

getAccumulatedInstantUsage

public double getAccumulatedInstantUsage()

setAccumulatedInstantUsage

public void setAccumulatedInstantUsage(double accumulatedInstantUsage)

accumulateInstantUsage

public void accumulateInstantUsage(double deltaUsage)
Use this to keep up to date the accumulated instant usage. The accumulated instant usage includes the usage from InstantaneousUsageReports that have accumulated at this instant as well as the instant usage that has accumulated at all previous elements.


getNextElementId

public long getNextElementId()

setNextElementId

public void setNextElementId(long nextElementInstant)

toString

public String toString()

Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Check if this object is equal to another object.

For the definition of the object equivalence relation see Object.equals(Object).

Overrides:
equals in class Object
Parameters:
obj - another, possibly equal object.
Returns:
true if the objects are equal, false otherwise.
See Also:
Object.equals(Object)

equalsByValue

public boolean equalsByValue(Object obj)

hashCode

public int hashCode()
Calculate the hash code for this object.

The rules laid out in J. Blosh's Effective Java are used for the hash code calculation.

Overrides:
hashCode in class Object
Returns:
the hash code.
See Also:
Object.hashCode()

clone

public Object clone()
Overrides:
clone in class Object


Copyright © 2001-2007 University of Southampton IT Innovation Centre. All Rights Reserved.