edu.isi.pegasus.planner.visualize.spaceusage
Class Space

java.lang.Object
  extended by edu.isi.pegasus.planner.visualize.spaceusage.Space
All Implemented Interfaces:
Cloneable

public class Space
extends Object
implements Cloneable

A data class that stores the space usage.

Version:
$Revision: 2563 $
Author:
Karan Vahi

Field Summary
private  String mAssociatedJob
          The jobname for which the reading was taken.
private  boolean mCleanupSpace
          Indicates whether the space denoted is the amount of space cleaned up.
private  Date mDate
          Holds the timestamp when usage was taken.
private  int mIndex
          index to do conversions between units.
private  float mSize
          The size.
private  char mUnit
          The units in which the size is stored.
 
Constructor Summary
Space(Date d)
          The overloaded constructor.
Space(Date d, String size)
          The overloaded constructor.
 
Method Summary
 Object clone()
          Returns the clone of the object.
 String getAssociatedJob()
          Returns the associated job.
 boolean getCleanupFlag()
          Returns boolean indicating whether the space denoted is the amount cleaned or not.
 Date getDate()
          Returns the time at which Space was record.
private  int getIndex()
          Returns the index for the associated unit.
private  int getIndex(char u)
          Returns the index for a unit.
private  float getMultiplyingFactor(int base, int power)
          Returns multiplying factor for conversion.
 float getSize()
          Returns the size in the units associated with it.
 float getSize(char u)
          Returns the size in particular unit.
 char getUnits()
          Returns the units associated with the size.
 void setAssociatedJob(String job)
          Sets the associated job for which the reading was taken.
 void setCleanupFlag(boolean cleanup)
          Sets boolean indicating that space denoted is the amount cleaned.
 void setSize(float size, char unit)
          Sets the size.
 void setSize(String size)
          Sets the size.
 String toString()
          Returns a textual description of the content
 boolean validUnit(char c)
          Returns if a character is a valid unit or not
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mDate

private Date mDate
Holds the timestamp when usage was taken.


mSize

private float mSize
The size.


mUnit

private char mUnit
The units in which the size is stored. M for megabyte, K for Kilobytes, T for terabytes. The default unit is K


mIndex

private int mIndex
index to do conversions between units.


mCleanupSpace

private boolean mCleanupSpace
Indicates whether the space denoted is the amount of space cleaned up.


mAssociatedJob

private String mAssociatedJob
The jobname for which the reading was taken.

Constructor Detail

Space

public Space(Date d)
The overloaded constructor.

Parameters:
d - the date.

Space

public Space(Date d,
             String size)
The overloaded constructor.

Parameters:
d - Date
size - the size with the last character denoting the unit.
Method Detail

setCleanupFlag

public void setCleanupFlag(boolean cleanup)
Sets boolean indicating that space denoted is the amount cleaned.

Parameters:
cleanup - boolean indicating that value is cleaned up.

setAssociatedJob

public void setAssociatedJob(String job)
Sets the associated job for which the reading was taken.

Parameters:
job - the associated job.

getAssociatedJob

public String getAssociatedJob()
Returns the associated job.

Returns:
the associated job.

getCleanupFlag

public boolean getCleanupFlag()
Returns boolean indicating whether the space denoted is the amount cleaned or not.

Returns:
boolean indicating that value is cleaned up.

setSize

public void setSize(float size,
                    char unit)
Sets the size.

Parameters:
size - the size optionally with the units.
unit - the unit of the size

setSize

public void setSize(String size)
Sets the size.

Parameters:
size - the size optionally with the units.

getDate

public Date getDate()
Returns the time at which Space was record.

Returns:
Date

getSize

public float getSize()
Returns the size in the units associated with it.

Returns:
size in float

getSize

public float getSize(char u)
Returns the size in particular unit.

Parameters:
u - the unit.
Returns:
size in float

getUnits

public char getUnits()
Returns the units associated with the size.

Returns:
the unit

validUnit

public boolean validUnit(char c)
Returns if a character is a valid unit or not

Parameters:
c - the unit
Returns:
boolean

toString

public String toString()
Returns a textual description of the content

Overrides:
toString in class Object
Returns:
String.

clone

public Object clone()
Returns the clone of the object.

Overrides:
clone in class Object
Returns:
the clone

getIndex

private int getIndex()
Returns the index for the associated unit.

Returns:
the index.

getIndex

private int getIndex(char u)
Returns the index for a unit.

Parameters:
u - the unit
Returns:
the index.

getMultiplyingFactor

private float getMultiplyingFactor(int base,
                                   int power)
Returns multiplying factor for conversion. Simulates ^ operator.

Parameters:
base -
power - the power to raise the base to.
Returns:
multiplying value


Copyright © 2011 The University of Southern California. All Rights Reserved.