|
tauZaman v0.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--tauzaman.calendar.Calendar
Calendar
class represents a Calendar, which defines the time values
of interest to user, usually over a specific segment of the physical time-line.
Calendar
keeps Granularity/additional FieldName(s) information and
provides Calendar dependent functions for time-stamp/temporal constant conversions.
Calendar
s can be formed given Calendar specification files' URL
s, which are fetched as String and formed by CalendricSystem
from Calendric System specification files. For example;
URL
url = newURL
("http://www.eecs.wsu.edu/burgun/calendars/Gregorian/GregV1.cal"); Calendar calendar = new Calendar(url);
Also Calendar
s are kept in a database called CalendarRepository
.
CalendarRepository
,
CalendricSystem
,
ClassLoaderMethodCaller
Field Summary | |
private ClassLoaderMethodCaller |
clmc
A ClassLoaderMethodCaller instance that provides access to
regular functions, which are loaded dynamically.
|
private Granularity[] |
granularities
Array of Granularities that this Calendar contains. |
private java.net.URL |
implUrl
Url of this Calendar implementation. |
private Mapping[] |
mappings
Array of Mappings that this Calendar contains. |
private Granularity |
underlyingGranularity
Underlying Granularity of this Calendar . |
private java.net.URL |
url
Url of this Calendar , which is the Primary Key in CalendarRepository . |
Constructor Summary | |
Calendar(java.net.URL url)
Constructs a Calendar object from a given Calendar Specification url in a Calendric System Specification file. |
Method Summary | |
boolean |
equals(java.lang.Object obj)
Returns true if URL of this Calendar is equal to
given Calendar . |
Granule |
fieldsToGranule(Fields fields)
Forms and returns a Granule , which contains a Granularity ,
given Fields object, which is formed by Input by parsing
a temporal constant input string. |
private void |
formCalendar()
Initializes the state of this Calendar using
the Calendar Specification file pointed by a URL. |
private int |
getConverseRel(int rel)
|
Granularity[] |
getGranularities()
Returns Granularities of this
Calendar . |
Granularity |
getGranularityByLocalName(java.lang.String localName)
Returns Granularity of this Calendar given its local name. |
Mapping[] |
getMappings()
Returns Mapping s of this
Calendar . |
Granularity |
getUnderlyingGranularity()
Returns underlying Granularity of this
Calendar . |
java.net.URL |
getUrl()
Returns the URL, which is also Primary Key in CalendarRepository , of this Calendar . |
boolean |
granuleToFields(Granule granule,
Fields fields)
Forms and returns a Fields , which is unpacked version of a
timestamp parsed into each Field . |
java.lang.String |
toString()
Returns string representation of this Calendar . |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private java.net.URL url
Calendar
, which is the Primary Key in CalendarRepository
.
private java.net.URL implUrl
Calendar
implementation.
private ClassLoaderMethodCaller clmc
ClassLoaderMethodCaller
instance that provides access to
regular functions, which are loaded dynamically.
regular functions refer to two functions, which all Calendar
s
should have: "granuleToFields and fieldsToGranule"
private Granularity[] granularities
Granularities
that this Calendar
contains.
private Mapping[] mappings
Mappings
that this Calendar
contains.
private Granularity underlyingGranularity
Granularity
of this Calendar
.
Constructor Detail |
public Calendar(java.net.URL url) throws CalendarFormationException
url
- URL of Calendar Specification file.
CalendarFormationException
- If any problem
happens while parsing the file; Any problem related to xml parsing,
any bad information fetched from parsed file, such as, a bad URL or
a URL that causes problems with dynamic loading.Method Detail |
private void formCalendar() throws CalendarFormationException
Calendar
using
the Calendar Specification file pointed by a URL.
CalendarFormationException
- If any problem
happens while parsing the file; Any problem related to xml parsing,
any bad information fetched from parsed file, such as, a bad URL or
a URL that causes problems with dynamic loading.public Granularity getGranularityByLocalName(java.lang.String localName)
Granularity
of this Calendar
given its local name.
localName
- String local name of a Granularity
Granularity
of this Calendar
given its local name. Returns null if no such Granularity
exists.public java.net.URL getUrl()
CalendarRepository
, of this Calendar
.
Calendar
public boolean equals(java.lang.Object obj)
Calendar
is equal to
given Calendar
.
equals
in class java.lang.Object
Calendar
equals to
given Calendar
public Granule fieldsToGranule(Fields fields) throws CalendarServiceException
Forms and returns a Granule
, which contains a Granularity
,
given Fields
object, which is formed by Input
by parsing
a temporal constant input string. This is a regular Calendar
function, which means every Calendar
is required to implement it.
This method calls actual implementation, which is loaded dynamically from given URL in Calendar Specification file.
fields
- temporal constant input string, which is parsed into its Field
s
Granule
formed given Fields
object
CalendarServiceException
- if any problem occurs when performing
this dynamically loaded method, this also includes problems with dynamic loading
exceptions.Fields
,
Field
,
Granule
,
Property
public boolean granuleToFields(Granule granule, Fields fields) throws CalendarServiceException
Forms and returns a Fields
, which is unpacked version of a
timestamp parsed into each Field
. This is a regular
Calendar
function, which means every Calendar
is required to implement it.
This method calls actual implementation, which is loaded dynamically from given URL in Calendar Specification file.
CalendarServiceException
- if any problem occurs when performing
this dynamically loaded method, this also includes problems with dynamic loading
exceptions.Fields
,
Field
,
Granule
,
Property
public Granularity[] getGranularities()
Granularities
of this
Calendar
.
Granularities
public Mapping[] getMappings()
Mapping
s of this
Calendar
.
Mapping
spublic Granularity getUnderlyingGranularity()
Granularity
of this
Calendar
.
Granularity
public java.lang.String toString()
Calendar
.
toString
in class java.lang.Object
private int getConverseRel(int rel)
|
tauZaman v0.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |