|
tauZaman v0.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--tauzaman.calendricsystem.CalendricSystem
CalendricSystem
class represents a Calendric System, which contains
Calendar
s' Epoch
s and provides an entrance point to
all Epoch
and Calendar
services.
Calendar
,
PropertyManager
Field Summary | |
private java.util.Hashtable |
calendarNamesToCalendars
Keeps Calendar names as its keys and
Calendar |
private Calendar[] |
calendars
List of handle(s) of Calendar (s) that this calendric system contains, in
the order of default input order, which is defined in Calendar Specification
file. |
private java.util.Hashtable |
calendarUrlsToCalendarNames
Keeps Calendar urls as its keys and
Calendar |
private CalendarRepository |
cr
a handle to unique CalendarRepository of, CalendricSystemRepository ,
indirectly this TauZamanSystem |
(package private) Granularity |
defaultGranularity
Default Granularity of this CalendricSystem . |
private GranularityLattice |
lattice
jkm |
private Mapping[] |
mappings
Granularity mappings belong to this CalendricSystem . |
(package private) java.lang.String |
token
Default regular expression for useful information in inputs. |
private java.net.URL |
url
Url of the this CalendricSystem , which is enforced to be unique in
database |
Constructor Summary | |
CalendricSystem(CalendarRepository cr,
java.net.URL url)
Constructs a CalendricSystem object;
Forms a CalendricSystem by parsing url. |
Method Summary | |
Granule |
castDeterminantInstant(Granule granule,
Granularity toGranularity)
|
void |
clearCaches()
|
private void |
formCalendricSystem()
Initializes this CalendricSystem 's states by
parsing file that its url points. |
private Granularity |
formGranularity(java.lang.String localName,
java.lang.String calendarName)
Returns a Granularity produced from global identity of mapping elements. |
Calendar[] |
getAllCalendars()
Returns all Calendar s in this CalendricSystem . |
Calendar |
getCalendar(java.lang.String calendarName)
|
Granularity |
getDefaultGranularity()
Returns default Granularity of this CalendricSystem . |
java.lang.String |
getDefaultRegex()
Returns default regular expression for this CalendricSystem |
GranularityLattice |
getGranularityLattice()
|
Mapping[] |
getMappings()
Returns Mapping s of this
CalendricSystem . |
Calendar[] |
getOrderedCalendars(Property overrideInputOrderProperty)
Returns an array of ordered list of Calendar s for converting
a temporal data type to corresponding output string. |
java.net.URL |
getUrl()
Returns url of this CalendricSystem 's specification file. |
boolean |
isCoarser(Granularity g1,
Granularity g2)
|
boolean |
isEquivalent(Granularity g1,
Granularity g2)
|
boolean |
isFiner(Granularity g1,
Granularity g2)
|
boolean |
isIncomparable(Granularity g1,
Granularity g2)
|
java.lang.String |
toString()
Returns url of this CalendricSystem . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private java.net.URL url
CalendricSystem
, which is enforced to be unique in
database
private Calendar[] calendars
Calendar
(s) that this calendric system contains, in
the order of default input order, which is defined in Calendar Specification
file.
Calendar
private java.util.Hashtable calendarNamesToCalendars
Calendar
names as its keys and
Calendars as values.
calendarUrlsToCalendarNames
private java.util.Hashtable calendarUrlsToCalendarNames
- Keeps
Calendar
urls as its keys and
Calendar names as values.
mappings
private Mapping[] mappings
- Granularity mappings belong to this
CalendricSystem
.
token
java.lang.String token
- Default regular expression for useful information in inputs.
defaultGranularity
Granularity defaultGranularity
- Default
Granularity
of this CalendricSystem
.
cr
private CalendarRepository cr
- a handle to unique
CalendarRepository
of, CalendricSystemRepository
,
indirectly this TauZamanSystem
lattice
private GranularityLattice lattice
- jkm
Constructor Detail
CalendricSystem
public CalendricSystem(CalendarRepository cr,
java.net.URL url)
throws CalendricSystemFormationException
- Constructs a
CalendricSystem
object;
Forms a CalendricSystem
by parsing url.
- Parameters:
cr
- CalendarRepository
, which this CalendricSystem
will use to load Calendar
s
- Throws:
CalendricSystemFormationException
- if any error occurs while forming
CalendricSystem
from given URL
Method Detail
getUrl
public java.net.URL getUrl()
- Returns url of this
CalendricSystem
's specification file.
- Returns:
- URL url of this
CalendricSystem
getAllCalendars
public Calendar[] getAllCalendars()
- Returns all
Calendar
s in this CalendricSystem
.
- Returns:
- array of
Calendar
s
getDefaultRegex
public java.lang.String getDefaultRegex()
- Returns default regular expression for this
CalendricSystem
formCalendricSystem
private void formCalendricSystem()
throws CalendricSystemFormationException
- Initializes this
CalendricSystem
's states by
parsing file that its url points.
- Throws:
CalendricSystemFormationException
- if any error occurs while forming
CalendricSystem
from given URL
getMappings
public Mapping[] getMappings()
- Returns
Mapping
s of this
CalendricSystem
.
- Returns:
- an array of
Mapping
s
formGranularity
private Granularity formGranularity(java.lang.String localName,
java.lang.String calendarName)
throws CalendricSystemFormationException
- Returns a
Granularity
produced from global identity of mapping elements. It also
checks validity of mapping names.
- Parameters:
localName
- String name of Granularity
given as in CalendricSystem
spec filecalendarName
- String name of Calendar
given as in CalendricSystem
spec file
- Returns:
Granularity
- Throws:
CalendricSystemFormationException
- if any abnormal condition occurs when forming
Granularity
getDefaultGranularity
public Granularity getDefaultGranularity()
- Returns default
Granularity
of this CalendricSystem
.
- Returns:
Granularity
, which is the default Granularity
getOrderedCalendars
public Calendar[] getOrderedCalendars(Property overrideInputOrderProperty)
throws CalendricSystemServiceException
- Returns an array of ordered list of
Calendar
s for converting
a temporal data type to corresponding output string.
- Parameters:
overrideInputOrderProperty
- Property
that will be used
when forming an ordered input calendar list
- Returns:
- array of ordered
Calendar
s
- Throws:
CalendricSystemServiceException
- if any problem occurs when forming
an ordered Calendar
list
toString
public java.lang.String toString()
- Returns url of this
CalendricSystem
.
- Overrides:
toString
in class java.lang.Object
- Returns:
- String representation of a URL
getGranularityLattice
public GranularityLattice getGranularityLattice()
getCalendar
public Calendar getCalendar(java.lang.String calendarName)
castDeterminantInstant
public Granule castDeterminantInstant(Granule granule,
Granularity toGranularity)
throws CalendricSystemServiceException
CalendricSystemServiceException
isCoarser
public boolean isCoarser(Granularity g1,
Granularity g2)
throws CalendricSystemServiceException
CalendricSystemServiceException
isEquivalent
public boolean isEquivalent(Granularity g1,
Granularity g2)
throws CalendricSystemServiceException
CalendricSystemServiceException
isFiner
public boolean isFiner(Granularity g1,
Granularity g2)
throws CalendricSystemServiceException
CalendricSystemServiceException
isIncomparable
public boolean isIncomparable(Granularity g1,
Granularity g2)
throws CalendricSystemServiceException
CalendricSystemServiceException
clearCaches
public void clearCaches()
Overview
Package
Class
Tree
Deprecated
Index
Help
tauZaman
v0.1
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
Submit a bug or feature
tauZaman is an open-source, publicly avaliable project