wt.projmgmt.resource
Class Work

java.lang.Object
  extended bywt.projmgmt.resource.Work
All Implemented Interfaces:
Externalizable, Serializable

public class Work
extends Object
implements Externalizable

Work encapsulates project management effort for . It indicates how much time a certain task has consumed or is planned or budgeted to consume.

Work is implemented simply as a double. Also the default time unit is an "hour."

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static double PRECISION
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private  double value
           
private static boolean VERBOSE
           
 
Constructor Summary
Work()
          

Supported API: false
Work(double value)
          

Supported API: false
 
Method Summary
 Work copy()
          returns an identical Work object.
 double doubleValue()
          Returns the internal representtaion of the Work iobject.
 boolean equals(Object object)
          Returns true if two work objects are considered equal and false otherwise.
static Work getWorkInDays(String str)
          Returns a Work given a string.
static Work getWorkInHours(String str)
          Returns a Work given a string.
 int hashCode()
          Work hashCode.
static double parseWork(String str)
          Helper function that parses a String into a Work object.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(Work thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 String toString()
          Produces string representation of the object.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

value

private double value

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

PRECISION

private static final double PRECISION

VERBOSE

private static final boolean VERBOSE
Constructor Detail

Work

public Work()


Supported API: false


Work

public Work(double value)


Supported API: false

Parameters:
value -
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(Work thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

toString

public String toString()
Produces string representation of the object. This representtaion consists of a number with a decimal period followed by the text "hours"

Supported API: false

Returns:
String

equals

public boolean equals(Object object)
Returns true if two work objects are considered equal and false otherwise. Two work objects are equals if they differ for less than a user setable constant. The constant can be set in wt.properties (wt.projmgmt.resource.workPrecision). The default value is 1000.

Supported API: false

Parameters:
object -
Returns:
boolean

hashCode

public int hashCode()
Work hashCode.

Supported API: false

Returns:
int

copy

public Work copy()
returns an identical Work object.

Supported API: false

Returns:
Work

doubleValue

public double doubleValue()
Returns the internal representtaion of the Work iobject.

Supported API: false

Returns:
double

parseWork

public static double parseWork(String str)
                        throws NumberFormatException
Helper function that parses a String into a Work object. Cleans string of extraneous characters and passes it to the wt.lang.Double#parseDouble method.

Supported API: false

Parameters:
str -
Returns:
double
Throws:
NumberFormatException

getWorkInDays

public static Work getWorkInDays(String str)
                          throws NumberFormatException
Returns a Work given a string. The String passed as argument is assumed to contain a double number representing the work in "days"

Supported API: false

Parameters:
str -
Returns:
Work
Throws:
NumberFormatException

getWorkInHours

public static Work getWorkInHours(String str)
Returns a Work given a string. The String passed as argument is assumed to contain a double number representing the work in "hours"

Supported API: false

Parameters:
str -
Returns:
Work