public interface LetoPeriodStructure
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName() |
java.lang.String |
getName(java.util.Locale locale)
Return the human readable name of this structure if one is available or just return null if no specific name
is defined.
|
java.util.Map<java.util.Locale,java.lang.String> |
getNameTranslations() |
LetoPeriodType |
getPeriodType()
Return a reference to the abstract period type, this strucutre describes.
|
LetoPeriodStructure[] |
getSubPeriods()
Return sub-periods information for the given structure of the period type.
|
long |
getTotalLengthInDays()
Total length in days of the period type.
|
long |
getTotalLengthInPeriodTypes(LetoPeriodType periodType)
This will return how many period types are contained in this type structure.
|
void |
setPeriodType(LetoPeriodType period)
Once the period is set (to something different than null) either by the constructor or the setPeriodType method,
it can no longer be reset to any value.
|
LetoPeriodType getPeriodType()
void setPeriodType(LetoPeriodType period) throws LetoExceptionUnrecoverable
period
- The period type that has to be set to this strucutre.LetoExceptionUnrecoverable
- If the period type of this strucutre is already set.long getTotalLengthInDays()
long getTotalLengthInPeriodTypes(LetoPeriodType periodType)
periodType
- We need to return how many periods of this type are available in this period structure.
For example if the type structure is a leap year and the period type is day, then it would return how
many days are inside a leap year. In that example - 366.LetoPeriodStructure[] getSubPeriods()
getTotalLengthInDays()
365 and the method
getSubPeriods()
will return the actual separation of this non-leap year into 12 months.
The result will be an array of 12 elements - an element for each month. Each of this 12 elements will
refer to the subtype "month".java.lang.String getName(java.util.Locale locale)
locale
- The locale to be used to return the name of the structure. For example if locale is
java.util.Locale ENGLISH, then the implementation might output "January",
while if the Locale is Bulgarian, then it might output "Yanuary" or "Януари".
If the locale parameter is null, then the implementation should output some default value.java.lang.String getName()
java.util.Map<java.util.Locale,java.lang.String> getNameTranslations()