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(java.util.Date dStart,
java.util.Date dEnd)
Constructs a ColumnPeriod instance for the two dates indicated
The HasBoySupport parameter that exists in other constructors
is taken from the AppContext.getApplication() so make sure
an application is set and that application implements the HasBoySupport
interface
|
ColumnPeriod(java.util.GregorianCalendar pStart,
java.util.GregorianCalendar pEnd)
Creates a non standard column period with two dates.
|
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.Date dStart,
java.util.Date dEnd)
Creates a non standard column period with two dates.
|
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.
|
ColumnPeriod(java.lang.String periodSPart)
Creates a column period form its string serialization.
|
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)
Equals.
|
boolean |
equals(XBRLPeriod p)
Specific comparator to compare a ColumnPeriod with an XBRLPeriod for equality.
|
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.
|
java.lang.String |
getStringColumnPeriod(boolean normalizeInstant)
Gets the string column period.
|
java.lang.String |
getStringColumnPeriodExtended()
Gets the string column period extended info.
|
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()
Hash code.
|
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.
|
XBRLPeriod |
toPeriod(DTSContainer dts,
HandleDateStep.InstantMode mode)
Transforms back this column period into an XBRLPeriod and considers some
special cases for duration periods: When mode is BOP an instant period
is returned and the date is set to this ColumnPeriod start date, When mode
is EOP an instant period is returned and the date is set to this ColumnPeriod
end date.
|
java.lang.String |
toString()
To string.
|
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, java.util.Date dStart, java.util.Date dEnd)
boyManager
- the boy managerdStart
- Initial date for the column perioddEnd
- End date for the column periodpublic ColumnPeriod(java.util.GregorianCalendar pStart, java.util.GregorianCalendar pEnd)
If two dates are null, the column period will be forever.
If both dates are equal and not null, the ColumnPeriod is an instant.
The HasBoySupport parameter that exists in other constructors is taken from the AppContext.getApplication() so make sure an application is set and that application implements the HasBoySupport interface
pStart
- Initial date for the column periodpEnd
- End date for the column periodpublic ColumnPeriod(java.util.Date dStart, java.util.Date dEnd)
The HasBoySupport parameter that exists in other constructors is taken from the AppContext.getApplication() so make sure an application is set and that application implements the HasBoySupport interface
dStart
- the start datedEnd
- the end datepublic ColumnPeriod(HasBoySupport boyManager, ColumnPeriod period, int dateStep)
boyManager
- the boy managerperiod
- the perioddateStep
- the date steppublic ColumnPeriod(java.lang.String periodSPart)
periodSPart
- serialization of this classtoString()
public XBRLPeriod toPeriod(DTSContainer dts, HandleDateStep.InstantMode mode)
dts
- the DTSContainer assigned to new XBRLPeriodmode
- either BOP or EOP, other values are ignored and a standard duration
period is returnedpublic XBRLPeriod toPeriod(DTSContainer dts)
Note, there is another method #toPeriod(DTSContainer, InstantMode)
that
can be used when the new XBRLPeriod must match either the beginning or end of the ColumnPeriod
dts
- the DTSContainer that will be assigned to the XBRLPeriodpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getStringColumnPeriodExtended()
Suitable for GUI ColumnPeriod renderers.
public 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.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the objpublic boolean equals(XBRLPeriod p)
p
- the ppublic java.lang.String getStringColumnPeriod()
public java.lang.String getStringColumnPeriod(boolean normalizeInstant)
normalizeInstant
- if this is true, for instant periods, the date will be reported date minus 24 hourspublic 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 dateCopyright 2006-2015 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa