Primavera Integration API 7.0

com.primavera.common.value.spread
Interface SpreadData


public interface SpreadData

This interface defines the access methods that a spread data holder should implement.


Method Summary
 int addBucket(java.util.Date bucketStartDate)
          Adds a new bucket into the spread data.
 void clearFinancialValues()
          Clear all the cost/financial values
 java.util.Date getBucketEndDate(int bucketIndex)
          Find the bucket end time of a specified bucket.
 int getBucketIndex(java.util.Date date)
          Find the bucket index of the bucket that the specified date falls in.
 java.util.Date getBucketStart(java.util.Date date, SpreadBucketType bucketType)
          Trims the given date to the bucket start time
 java.util.Date getBucketStartDate(int bucketIndex)
          Find the bucket start time of a specified bucket.
 SpreadBucketType getBucketType()
          Get the bucket type of this batch of spread data.
 java.lang.String[] getCostFields()
          Get the cost fields in this spread data.
 double getDouble(java.lang.String fieldName, int bucketIndex)
          Get the spreaded value (either cumulative or period only) for this period.
 java.util.Date getNextBucketStart(java.util.Date date, SpreadBucketType bucketType)
          Gets the next bucket time by a given date
 java.util.Date getPreviousBucketStart(java.util.Date date, SpreadBucketType bucketType)
          Gets the previous bucket time by a given date
 java.util.Date getSpreadEnd()
          Find the end time of this batch of spread data.
 java.util.Date getSpreadStart()
          Find the start time of this batch of spread data.
 java.lang.String[] getUnitFields()
          Get the unit fields in this spread data.
 boolean isCumulativeData()
          Whether this batch of spread data holds cumulative data or period data only.
 void setDouble(java.lang.String fieldName, int bucketIndex, double value)
          Set the spreaded value (period only) for this period.
 int size()
          Get the number of buckets the spread data holds.
 

Method Detail

getUnitFields

java.lang.String[] getUnitFields()
Get the unit fields in this spread data.

Returns:
array of unit field names

getCostFields

java.lang.String[] getCostFields()
Get the cost fields in this spread data.

Returns:
array of cost field names

clearFinancialValues

void clearFinancialValues()
Clear all the cost/financial values


getSpreadStart

java.util.Date getSpreadStart()
Find the start time of this batch of spread data.

Returns:
start time of this spread

getSpreadEnd

java.util.Date getSpreadEnd()
Find the end time of this batch of spread data.

Returns:
end time of this spread

getBucketType

SpreadBucketType getBucketType()
Get the bucket type of this batch of spread data.

Returns:
bucket type

size

int size()
Get the number of buckets the spread data holds.

Returns:
the number of buckets

addBucket

int addBucket(java.util.Date bucketStartDate)
Adds a new bucket into the spread data.

Parameters:
bucketStartDate - the bucket start date. If it is not a bucket start, a bucket that contains this date will be added.
Returns:
the bucket index

getBucketStartDate

java.util.Date getBucketStartDate(int bucketIndex)
Find the bucket start time of a specified bucket.

Parameters:
bucketIndex - the bucket index of this batch of buckets
Returns:
bucket start time

getBucketEndDate

java.util.Date getBucketEndDate(int bucketIndex)
Find the bucket end time of a specified bucket.

Parameters:
bucketIndex - the bucket index of this batch of buckets
Returns:
bucket end time

getBucketIndex

int getBucketIndex(java.util.Date date)
Find the bucket index of the bucket that the specified date falls in.

Parameters:
date - the date that shall fall in a bucket start and end time
Returns:
the bucket index of this batch of buckets

getDouble

double getDouble(java.lang.String fieldName,
                 int bucketIndex)
                 throws SpreadFieldNotFoundException
Get the spreaded value (either cumulative or period only) for this period.

Parameters:
fieldName - the spread field name
bucketIndex - the bucket index of this batch of buckets
Returns:
the cumulative or period only spreaded value
Throws:
SpreadFieldNotFoundException - if the spread field is not valid

setDouble

void setDouble(java.lang.String fieldName,
               int bucketIndex,
               double value)
               throws SpreadFieldNotFoundException
Set the spreaded value (period only) for this period.

Parameters:
fieldName - the spread field name
bucketIndex - the bucket index of this batch of buckets
value - the period only spreaded value
Throws:
SpreadFieldNotFoundException - if the spread field is not valid

isCumulativeData

boolean isCumulativeData()
Whether this batch of spread data holds cumulative data or period data only.

Returns:
true if cumulative data, false period data only

getBucketStart

java.util.Date getBucketStart(java.util.Date date,
                              SpreadBucketType bucketType)
Trims the given date to the bucket start time

Parameters:
date - any given date
bucketType - the spread bucket size
Returns:
the bucket start time aligned with buckets

getPreviousBucketStart

java.util.Date getPreviousBucketStart(java.util.Date date,
                                      SpreadBucketType bucketType)
Gets the previous bucket time by a given date

Parameters:
date - any given date
bucketType - the spread bucket size
Returns:
the previous bucket start time aligned with buckets

getNextBucketStart

java.util.Date getNextBucketStart(java.util.Date date,
                                  SpreadBucketType bucketType)
Gets the next bucket time by a given date

Parameters:
date - any given date
bucketType - the spread bucket size
Returns:
the next bucket start time aligned with buckets

Primavera Integration API 7.0

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