public class ColumnPeriod
extends java.lang.Object
The difference with an XBRLPeriod is that the interpretation of the reporting date for instant data. Instant data belongs to a period that may not match with the data in the XBRLPeriod context.
A ColumnPeriod does not contains contexts associated. Contexts are associated to FactColumns. There is a one to one relationship between a ColumnPeriod and a Factcolumns object.
| Modifier and Type | Class and Description |
|---|---|
static class |
ColumnPeriod.ColumnPeriodDurationComparator
The Class ColumnPeriodDurationComparator.
|
static class |
ColumnPeriod.ColumnPeriodEndComparator
The Class ColumnPeriodEndComparator.
|
static class |
ColumnPeriod.ColumnPeriodStartComparator
The Class ColumnPeriodStartComparator.
|
| Modifier and Type | Field and Description |
|---|---|
static ColumnPeriod.ColumnPeriodDurationComparator |
COLUMN_PERIOD_DURATION_COMPARATOR
The Constant COLUMN_PERIOD_DURATION_COMPARATOR.
|
static ColumnPeriod.ColumnPeriodEndComparator |
COLUMN_PERIOD_END_COMPARATOR
The Constant COLUMN_PERIOD_END_COMPARATOR.
|
static ColumnPeriod.ColumnPeriodStartComparator |
COLUMN_PERIOD_START_COMPARATOR
The Constant COLUMN_PERIOD_START_COMPARATOR.
|
| Constructor and Description |
|---|
ColumnPeriod(HasBoySupport boyManager,
ColumnPeriod period,
int dateStep)
Creates a new ColumnPeriod that starts at the same date as the column period in the
parameter but extends to the end of the dateStep in the second parameter.
|
ColumnPeriod(HasBoySupport boyManager,
java.util.GregorianCalendar pStart,
java.util.GregorianCalendar pEnd)
Creates a non standard column period with two dates.
|
ColumnPeriod(HasBoySupport boyManager,
java.util.GregorianCalendar pStart,
int dateStep)
Instantiates a new column period.
|
ColumnPeriod(HasBoySupport hb,
XBRLPeriod p)
Instantiates a new column period.
|
ColumnPeriod(HasBoySupport boyManager,
XBRLPeriod p,
int dateStep,
HandleDateStep.InstantMode instantMode)
Creates a column period using an XBRLPeriod, as source.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsDate(java.util.GregorianCalendar date)
Contains date.
|
boolean |
containsExcl(XBRLPeriod p)
Calculates whether or not this ColumnPeriod contains the Period passed as a parameter.
|
boolean |
containsIncl(XBRLPeriod p)
Calculates whether or not this ColumnPeriod contains the Period passed as a parameter.
|
boolean |
equals(java.lang.Object obj) |
int |
getBestFitDateStep()
Calculates the best fit date step for this column period.
|
static int |
getBestFitDateStep(XBRLPeriod period,
int instantValue)
Returns the value of the dateStep that better suites the value of the
period indicated as a parameter.
|
static int |
getBestFitDateStepOfTwoDates(java.util.GregorianCalendar start,
java.util.GregorianCalendar end)
Gets the best fit date step of two dates.
|
HasBoySupport |
getBoySupport()
Gets the boy support.
|
javax.xml.datatype.Duration |
getDuration()
Returns a Duration object representing the total length of this column.
|
java.util.GregorianCalendar |
getEnd()
Gets the end.
|
java.util.GregorianCalendar |
getStart()
Gets the start.
|
java.lang.String |
getStringColumnPeriod()
Gets the string column period.
|
static java.lang.String |
getStringRepresentationOfDuration(javax.xml.datatype.Duration d,
int dateStep)
Returns a string representation of the duration object in the units indicated in the dateStep parameter.
|
int |
hashCode() |
boolean |
isDuration()
Checks if is duration.
|
boolean |
isEnd(java.util.GregorianCalendar date)
Checks if is end.
|
boolean |
isEnd(XBRLPeriod p)
Checks if is end.
|
boolean |
isForever()
Checks if is forever.
|
boolean |
isInstant()
If the ColumnPeriod is for the same start and end date, then it is an instant column period.
|
boolean |
isStart(java.util.GregorianCalendar date)
Checks if is start.
|
boolean |
isStart(XBRLPeriod p)
Checks if is start.
|
java.util.GregorianCalendar |
normalizeDate(java.util.GregorianCalendar inDate)
Normalizes a date without paying attention to the date step.
|
java.util.GregorianCalendar |
normalizeEnd(java.util.GregorianCalendar date,
int dateStep)
Prepare a new GregorianCalendar that corresponds to the end date of period according to
the value of the dateStep.
|
java.util.GregorianCalendar |
normalizeStart(java.util.GregorianCalendar date,
int dateStep)
Prepare a new GregorianCalendar that corresponds to the beginning date of period according to
the value of the dateStep.
|
XBRLPeriod |
toPeriod(DTSContainer dts)
Transforms back this column period into an XBRLPeriod.
|
java.lang.String |
toString() |
public static final ColumnPeriod.ColumnPeriodStartComparator COLUMN_PERIOD_START_COMPARATOR
public static final ColumnPeriod.ColumnPeriodEndComparator COLUMN_PERIOD_END_COMPARATOR
public static final ColumnPeriod.ColumnPeriodDurationComparator COLUMN_PERIOD_DURATION_COMPARATOR
public ColumnPeriod(HasBoySupport boyManager, java.util.GregorianCalendar pStart, int dateStep)
boyManager - the boy managerpStart - the startdateStep - the date steppublic ColumnPeriod(HasBoySupport boyManager, XBRLPeriod p, int dateStep, HandleDateStep.InstantMode instantMode)
boyManager - provides information about the month calendar a fiscal year begins.p - XBRLPerioddateStep - constant indicating the period length.instantMode - for instant values this is the matching strategy with duration contexts.public ColumnPeriod(HasBoySupport hb, XBRLPeriod p)
hb - the hbp - the ppublic ColumnPeriod(HasBoySupport boyManager, java.util.GregorianCalendar pStart, java.util.GregorianCalendar pEnd)
boyManager - the boy managerpStart - Initial date for the column periodpEnd - End date for the column periodpublic ColumnPeriod(HasBoySupport boyManager, ColumnPeriod period, int dateStep)
boyManager - the boy managerperiod - the perioddateStep - the date steppublic XBRLPeriod toPeriod(DTSContainer dts)
dts - the dtspublic java.util.GregorianCalendar normalizeStart(java.util.GregorianCalendar date,
int dateStep)
date - the datedateStep - the date steppublic java.util.GregorianCalendar normalizeEnd(java.util.GregorianCalendar date,
int dateStep)
date - the datedateStep - the date steppublic java.util.GregorianCalendar getStart()
public java.util.GregorianCalendar getEnd()
public HasBoySupport getBoySupport()
public boolean isEnd(java.util.GregorianCalendar date)
date - the datepublic boolean isEnd(XBRLPeriod p)
p - the ppublic boolean isStart(XBRLPeriod p)
p - the ppublic boolean isInstant()
public boolean isDuration()
public boolean isStart(java.util.GregorianCalendar date)
date - the datepublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String getStringColumnPeriod()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isForever()
public boolean containsExcl(XBRLPeriod p)
true if the period is instant and the instant date is inside the boundaries of the column period or the period is duration and both dates are inside the boundaries of the column period AND the period is not in the boundaries of none of the column periods inside this column period (This is the meaning of the Excl suffix to this method).
p - a periodcontainsIncl(XBRLPeriod)public boolean containsIncl(XBRLPeriod p)
true if the period is instant and the instant date is inside the boundaries of the column period or the period is duration and both dates are inside the boundaries of the column period.
p - a periodcontainsExcl(XBRLPeriod)public boolean containsDate(java.util.GregorianCalendar date)
date - the datepublic int getBestFitDateStep()
public static int getBestFitDateStep(XBRLPeriod period, int instantValue)
If the period is instant, the instantValue is returned. If the context is
duration, then, depending on the duration length a value is returned.
If the value is 1 year then the value InstanceExplorer.YEARS is returned.
If the value is below 1 year and over 6 months then InstanceExplorer.HALVES is returned.
If the value is greater than a year the value -1 is returned (an error).
If the value is between 6 months and 3 months InstanceExplorer.QUARTERS is returned.
If the value is between 3 months and 1 months InstanceExplorer.QUARTERS is returned.
...
period - the XBRLPeriod to calculate the best fit durationinstantValue - the return value in case the period parameter is of instant type.public static int getBestFitDateStepOfTwoDates(java.util.GregorianCalendar start,
java.util.GregorianCalendar end)
start - the startend - the endpublic javax.xml.datatype.Duration getDuration()
public static java.lang.String getStringRepresentationOfDuration(javax.xml.datatype.Duration d,
int dateStep)
throws NotRepresentableDurationException
d - a javax.xml.datatype.Duration instancedateStep - the units that the parameter d has to be divided to and for which a string representation will be createdNotRepresentableDurationException - in case of problemspublic java.util.GregorianCalendar normalizeDate(java.util.GregorianCalendar inDate)
inDate - the in date