Primavera Integration API 7.0

com.primavera.common.value
Class DetailedWorkHours

java.lang.Object
  extended by com.primavera.common.value.DetailedWorkHours
All Implemented Interfaces:
java.io.Serializable

public class DetailedWorkHours
extends java.lang.Object
implements java.io.Serializable

This value type is used to define work-time for a particular day. The resolution is 30 minutes (half an hour)

See Also:
Serialized Form

Field Summary
static long WORKTIME_1_TO_5
          The default work-time map: 13:00-16:59
static long WORKTIME_8_TO_12
          The default work-time map: 8:00-11:59
static long WORKTIME_8_TO_12_AND_1_TO_5
          The default work-time map: 8:00-11:59 and 13:00-16:59
static long WORKTIME_8_TO_5
          The default work-time map: 8:00-16:59
static long WORKTIME_9_TO_12_AND_1_TO_5
          The default work-time map: 9:00-11:59 and 13:00-16:59
static long WORKTIME_9_TO_5
          The default work-time map: 9:00am-16:59
 
Constructor Summary
DetailedWorkHours(long lTimeMap)
          Constructs a DetailedWorkHours object with the given long time list.
DetailedWorkHours(java.lang.String sTimeList)
          Constructs a DetailedWorkHours object with the given String time list.
 
Method Summary
 boolean equals(java.lang.Object parm1)
          Compares this object against the specified object.
 double getFinishTime()
          Gets the finish of the work time
 double getStartTime()
          Gets the start of the work time
 long getTimeBitmapAsLong()
          Gets a time map value for this object
static long getTimeBitmapAsLong(double dStartIndex, double dEndIndex)
          Gets a time map value with given time range .
static long getTimeBitmapAsLong(java.lang.String sStartTime, java.lang.String sEndTime)
          Gets a time map value for the given time range
 java.lang.String getTimeBitmapAsString()
          Gets a time bit map as a String for this object .
 java.lang.String getTimeString()
          Gets a time string for this object.
 double getTotalWorkHours()
          Gets the total work time in minutes for this object
 int hashCode()
          Returns a hash code for this object.
 boolean isTimeOn(double dIndex)
          Indicates if the given time is work-time.
 boolean isTimeOn(java.lang.String sTime)
          Indicates if the given time is work-time.
 void turnTimeOff(double dStartIndex, double dEndIndex)
          Sets the time range to be non-work-time.
 void turnTimeOff(java.lang.String sStartTime, java.lang.String sEndTime)
          Sets the time range to be non-work-time.
 void turnTimeOn(double dStartIndex, double dEndIndex)
          Sets the time range to be work-time.
 void turnTimeOn(java.lang.String sStartTime, java.lang.String sEndTime)
          Sets the time range to be work-time.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WORKTIME_9_TO_5

public static final long WORKTIME_9_TO_5
The default work-time map: 9:00am-16:59

See Also:
Constant Field Values

WORKTIME_8_TO_5

public static final long WORKTIME_8_TO_5
The default work-time map: 8:00-16:59

See Also:
Constant Field Values

WORKTIME_9_TO_12_AND_1_TO_5

public static final long WORKTIME_9_TO_12_AND_1_TO_5
The default work-time map: 9:00-11:59 and 13:00-16:59

See Also:
Constant Field Values

WORKTIME_8_TO_12_AND_1_TO_5

public static final long WORKTIME_8_TO_12_AND_1_TO_5
The default work-time map: 8:00-11:59 and 13:00-16:59

See Also:
Constant Field Values

WORKTIME_8_TO_12

public static final long WORKTIME_8_TO_12
The default work-time map: 8:00-11:59

See Also:
Constant Field Values

WORKTIME_1_TO_5

public static final long WORKTIME_1_TO_5
The default work-time map: 13:00-16:59

See Also:
Constant Field Values
Constructor Detail

DetailedWorkHours

public DetailedWorkHours(long lTimeMap)
Constructs a DetailedWorkHours object with the given long time list.

Parameters:
lTimeMap - The lower 48 bits of lTimeMap indicate the half hours to be on or off.

DetailedWorkHours

public DetailedWorkHours(java.lang.String sTimeList)
                  throws ValueObjectException
Constructs a DetailedWorkHours object with the given String time list.

Parameters:
sTimeList - a semicolon-delimited string of work-time that includes the finish minutes: "0:30-5:29;8:00-11:59;22:00-23:59;"
Throws:
ValueObjectException - if the time list is invalid
Method Detail

isTimeOn

public boolean isTimeOn(double dIndex)
                 throws ValueObjectException
Indicates if the given time is work-time.

Parameters:
dIndex - - time index, from 0 to 23.5
Returns:
true if the given time is work-time
Throws:
ValueObjectException - - if the time index is out of bounds

isTimeOn

public boolean isTimeOn(java.lang.String sTime)
                 throws ValueObjectException
Indicates if the given time is work-time.

Parameters:
sTime - time value
Returns:
true if the given time is work-time
Throws:
ValueObjectException - - if the time value is invalid or the time index is out of bounds

turnTimeOn

public void turnTimeOn(double dStartIndex,
                       double dEndIndex)
                throws ValueObjectException
Sets the time range to be work-time.

Parameters:
dStartIndex - the start time index
dEndIndex - the end time index
Throws:
ValueObjectException - - if one or both time indexes are out of bounds

turnTimeOn

public void turnTimeOn(java.lang.String sStartTime,
                       java.lang.String sEndTime)
                throws ValueObjectException
Sets the time range to be work-time.

Parameters:
sStartTime - - the start time
sEndTime - - the end time
Throws:
ValueObjectException - - if the time value is invalid or the time index is out of bounds

turnTimeOff

public void turnTimeOff(double dStartIndex,
                        double dEndIndex)
                 throws ValueObjectException
Sets the time range to be non-work-time.

Parameters:
dStartIndex - the start time index, from 0 to 23.5
dEndIndex - the end time index, from 0 to 23.5
Throws:
ValueObjectException - - if either or both time indexes are out of bounds

turnTimeOff

public void turnTimeOff(java.lang.String sStartTime,
                        java.lang.String sEndTime)
                 throws ValueObjectException
Sets the time range to be non-work-time.

Parameters:
sStartTime - the start time
sEndTime - the end time
Throws:
ValueObjectException - if the time value is invalid or the time index is out of bounds

getTimeBitmapAsLong

public static long getTimeBitmapAsLong(double dStartIndex,
                                       double dEndIndex)
                                throws ValueObjectException
Gets a time map value with given time range .

Parameters:
dStartIndex - the start time index, from 0 to 23.5
dEndIndex - the end time index, from 0 to 23.5
Returns:
the time map
Throws:
ValueObjectException - if either or both time indexes are out of bounds

getTimeBitmapAsLong

public static long getTimeBitmapAsLong(java.lang.String sStartTime,
                                       java.lang.String sEndTime)
                                throws ValueObjectException
Gets a time map value for the given time range

Parameters:
sStartTime - the start time
sEndTime - the end time
Returns:
the time map
Throws:
ValueObjectException - if the time value is invalid or the time index is out of bounds

getTimeBitmapAsLong

public long getTimeBitmapAsLong()
Gets a time map value for this object

Returns:
the time map

getTimeBitmapAsString

public java.lang.String getTimeBitmapAsString()
Gets a time bit map as a String for this object .

Returns:
the time bit map as a String

getTimeString

public java.lang.String getTimeString()
Gets a time string for this object.

Returns:
the time String. i.e., "0:30-5:29;8:00-11:59;22:00-23:59;"

getTotalWorkHours

public double getTotalWorkHours()
Gets the total work time in minutes for this object

Returns:
the total work time

getStartTime

public double getStartTime()
Gets the start of the work time

Returns:
the start time as a double. Range is 0 to 23.5 for valid start times, or -1 for no work time.

getFinishTime

public double getFinishTime()
Gets the finish of the work time

Returns:
the finish time as a double. Range is 0.5 to 24 for valid start times, or -1 for no work time.

hashCode

public int hashCode()
Returns a hash code for this object.

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code

equals

public boolean equals(java.lang.Object parm1)
Compares this object against the specified object. The result is true if and only if the argument is not null and is a DetailedWorkHours object that has exactly the same time map long value.

Overrides:
equals in class java.lang.Object
Parameters:
parm1 - the reference object with which to compare.
Returns:
true if the day maps equal. false otherwise.

Primavera Integration API 7.0

Copyright © 2003, 2009, Oracle and/or its affiliates. All rights reserved.