Primavera Integration API 7.0

com.primavera.common.value.spread
Class BaseSpread

java.lang.Object
  extended by com.primavera.common.value.spread.BaseSpread
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
ActivitySpread, com.primavera.common.value.spread.ResourceAssignmentBaseSpread, WBSSpread

public abstract class BaseSpread
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

The base class of all main spread classes. You can access spread data for all periods by first obtaining an iterator using the getSpreadIterator method. This iterator allows access to the SpreadPeriod objects that have been loaded with this spread object. For each SpreadPeriod, you can then call the SpreadPeriod.getUnits(), SpreadPeriod.getCumulativeUnits(), SpreadPeriod.getCost(), or SpreadPeriod.getCumulativeCost() methods, passing in the unit or cost field name. To discover the unit or cost field names that have been loaded, use the getUnitFields() and getCostFields() methods.

See Also:
Serialized Form

Method Summary
 void clearFinancialValues()
          Security implementation: clear all the cost fields with a Double.NaN value.
 void ensureSpreadSpansDate(java.util.Date date)
          Makes sure that a bucket is available for the given date, and if not, adds a bucket for it.
 java.lang.String[] getCostFields()
          Gets the cost field names in the spread data.
 int getSpreadBucketType()
          Gets the bucket type of spread data.
 SpreadBucketType getSpreadBucketTypeEnum()
          Gets the bucket type of spread data in enum.
 java.util.Date getSpreadEnd()
          Gets the end date of this batch of spread data.
 java.util.Iterator<SpreadPeriod> getSpreadIterator(boolean bIncludeEmptyBuckets)
          Creates a spread iterator object through which to access spread data.
 SpreadPeriod getSpreadPeriod(java.util.Date date, boolean bIncludeEmptyBucket)
          Finds the spread period by a given date which falls in the bucket start time (inclusive) and end time (exclusive).
 java.util.Date getSpreadStart()
          Gets the start date of this batch of spread data.
 java.lang.String[] getUnitFields()
          Gets the unit field names in the spread data.
 boolean hasCumulativeData()
          Indicates whether cumulative data has been loaded
 int size()
          Gets the number of buckets in this batch of spread data.
 java.lang.String toString()
          Returns a string representation on this object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

hasCumulativeData

public boolean hasCumulativeData()
Indicates whether cumulative data has been loaded

Returns:
boolean whether cumulative data is available

clearFinancialValues

public void clearFinancialValues()
Security implementation: clear all the cost fields with a Double.NaN value.


getUnitFields

public java.lang.String[] getUnitFields()
Gets the unit field names in the spread data.

Returns:
an array of unit field names

getCostFields

public java.lang.String[] getCostFields()
Gets the cost field names in the spread data.

Returns:
an array of cost field names

size

public int size()
Gets the number of buckets in this batch of spread data.

Returns:
the number of non-empty buckets

getSpreadIterator

public java.util.Iterator<SpreadPeriod> getSpreadIterator(boolean bIncludeEmptyBuckets)
Creates a spread iterator object through which to access spread data. EPSSpreads will return an iterator for a collection of EPSSpreadPeriods, ResourceAssignmentSpreads will return an iterator for a collection of ResourceAssignmentSpreadPeriods, etc.

Parameters:
bIncludeEmptyBuckets - when the bucket the date falls in has no spread data, if true, return a spread period with 0 values for all period value fields, and previous cumulative values for all cumulative value fields; if false, skip the empty buckets. This parameter only applies to summarized spread types (EPSSpread, ProjectSpread, and WBSSpread) and does not apply to live spreads (ResourceAssignmentSpread).
Returns:
iterator an iterator for a type of SpreadPeriod collection

getSpreadBucketTypeEnum

public SpreadBucketType getSpreadBucketTypeEnum()
Gets the bucket type of spread data in enum.

Returns:
the bucket type in enum

getSpreadBucketType

public int getSpreadBucketType()
Gets the bucket type of spread data.

Returns:
the bucket type

getSpreadStart

public java.util.Date getSpreadStart()
Gets the start date of this batch of spread data.

Returns:
the spread start date

getSpreadEnd

public java.util.Date getSpreadEnd()
Gets the end date of this batch of spread data.

Returns:
the spread end time

ensureSpreadSpansDate

public void ensureSpreadSpansDate(java.util.Date date)
Makes sure that a bucket is available for the given date, and if not, adds a bucket for it.

Parameters:
date - the date you wish to have a bucket represent

getSpreadPeriod

public SpreadPeriod getSpreadPeriod(java.util.Date date,
                                    boolean bIncludeEmptyBucket)
                             throws SpreadOutOfRangeException
Finds the spread period by a given date which falls in the bucket start time (inclusive) and end time (exclusive).

Parameters:
date - the time when the spread period falls in
bIncludeEmptyBucket - this indicate what will be returned when there is no data in this period. If true, returned SpreadPeriod will contain 0 for all fields for period value (the cumulative value will be calculated from the previous bucket); if false, it will return null.
Returns:
the spread period the date falls in
Throws:
SpreadOutOfRangeException - if the date is out of the range of the spread start and end

toString

public java.lang.String toString()
Returns a string representation on this object

Overrides:
toString in class java.lang.Object
Returns:
String string representation of BaseSpread

Primavera Integration API 7.0

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