|
tauZaman v0.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--tauzaman.calendricsystem.granularitylattice.GranularityLattice
Field Summary | |
static boolean |
CACHE_DEBUG
|
Constructor Summary | |
GranularityLattice(Calendar[] calendars,
Mapping[] interCalMappings)
Constructs a GranularityLattice object. |
Method Summary | |
void |
addCalendar(Calendar calendar)
Adds an entire calendar to the lattice by going through each mapping in the calendar, adding any nodes that are not already in the lattice plus the edges connecting the nodes in each mapping. |
void |
addMapping(Mapping mapping)
Creates an edge between the "from" granularity and the "to" granularity in the Mapping object with the Mapping object
itself as the edge's label. |
Granule |
castAnchored(Granule granule,
Granularity toGranularity)
Uses the lattice to cast the given anchored granule from its granularity to another granularity. |
Granule |
castUnanchored(Granule granule,
Granularity toGranularity)
Uses the lattice to cast the given unanchored granule from its granularity to another granularity. |
void |
clearCaches()
Resets all of the lattice's caches. |
boolean |
isCoarser(Granularity g1,
Granularity g2)
Uses the lattice to determine if one granularity is coarser than another. |
boolean |
isEquivalent(Granularity g1,
Granularity g2)
Uses the lattice to determine if the two granularities are equivalent. |
boolean |
isFiner(Granularity g1,
Granularity g2)
Uses the lattice to determine if one granularity is finer than another. |
boolean |
isIncomparable(Granularity g1,
Granularity g2)
Uses the lattice to determine if the two granularities are equivalent. |
java.lang.String |
toString()
Returns a string representation of the lattice. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static boolean CACHE_DEBUG
Constructor Detail |
public GranularityLattice(Calendar[] calendars, Mapping[] interCalMappings) throws CalendricSystemFormationException
GranularityLattice
object. The construction is
done by:
(1) For each calendar in calendars, get the calendar's mappings and set
up LatticeNodes
for each granularity encountered and
connecting the nodes with the mappings themselves.
(2) Connecting the granularities in different calendars using the
mappings in the inter-calendar mappings array.
calendars
- the array of all Calendar objects that are
in this calendric system
CalendricSystemFormationException
- if any error occurs while
forming GranularityLattice
Method Detail |
public void addCalendar(Calendar calendar) throws CalendricSystemFormationException
calendar
- Calendar
to be added to the lattice
CalendricSystemFormationException
public void addMapping(Mapping mapping) throws CalendricSystemFormationException
Mapping
object with the Mapping
object
itself as the edge's label.
mapping
- Mapping
that is the edge's label
NoSuchGranularityException
- if either of the Granularities in the
mapping are not recognized by the lattice (i.e., there is no node
in the lattice that has this granularity)
CalendricSystemFormationException
public Granule castAnchored(Granule granule, Granularity toGranularity) throws CalendricSystemServiceException
granule
- the granule to cast from its granularity to
another granularitytoGranularity
- the granularity to which to cast the given
granule
CalendricSystemServiceException
- if either the Granularity of the
given granule or the toGranularity are not recognized by the
lattice (i.e., there is no node in the lattice that has this
granularity)public Granule castUnanchored(Granule granule, Granularity toGranularity) throws CalendricSystemServiceException
granule
- the granule to cast from its granularity to
another granularitytoGranularity
- the granularity to which to cast the given
granule
CalendricSystemServiceException
- if either the Granularity of the
given granule or the toGranularity are not recognized by the
lattice (i.e., there is no node in the lattice that has this
granularity)public boolean isCoarser(Granularity g1, Granularity g2) throws CalendricSystemServiceException
g1
- the first granule to be comparedg2
- the second granule to be compared
true
if g1 is coarser than g2, false
if
g1 is finer than g2 or if g1 and g2 cannot be compared
NoSuchGranularityException
- if either of the granularities passed
in are not recognized by the lattice (i.e., there is no node in
the lattice that has this granularity)
CalendricSystemServiceException
public boolean isEquivalent(Granularity g1, Granularity g2) throws CalendricSystemServiceException
g1
- the first granule to be compared for equivalenceg2
- the second granule to be compared for equivalence
true
if g1 is equivalent to g2, false
if g1 is not equivalent to g2
NoSuchGranularityException
- if either of the granularities passed
in are not recognized by the lattice (i.e., there is no node in
the lattice that has this granularity)
CalendricSystemServiceException
public boolean isIncomparable(Granularity g1, Granularity g2) throws CalendricSystemServiceException
g1
- the first granule to be compared for equivalenceg2
- the second granule to be compared for equivalence
true
if g1 is equivalent to g2, false
if g1 is not equivalent to g2
NoSuchGranularityException
- if either of the granularities passed
in are not recognized by the lattice (i.e., there is no node in
the lattice that has this granularity)
CalendricSystemServiceException
public boolean isFiner(Granularity g1, Granularity g2) throws CalendricSystemServiceException
g1
- the first granule to be comparedg2
- the second granule to be compared
true
if g1 is finer than g2, false
if
g1 is coarser than g2 or if g1 and g2 cannot be compared
NoSuchGranularityException
- if either of the granularities passed
in are not recognized by the lattice (i.e., there is no node in
the lattice that has this granularity)
CalendricSystemServiceException
public void clearCaches()
public java.lang.String toString()
toString
in class java.lang.Object
|
tauZaman v0.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |