|
tauZaman v0.1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--tauzaman.timestamp.Granule
|
+--tauzaman.timestamp.NowRelativeGranule
The Granule class implements the arithmetic and comparison
operations on Granules. A Granule is the most basic unit of time in
a given Granularity. Each granule is a (TimeValue) distance (in granules).
Granules can be used for both unanchored and anchored times. If the time
is anchored, the Granule represents the distance from the granularity
anchor point. If the time is unanchored, the Granule just represents
a distance. Granules can be further classified as determinate or
indeterminate. A determinate granule has a known, fixed distance.
An indeterminate granule is some distance between a lower and upper
bound. A probability mass function determines the probability of
each indeterminate alternative.
Granules can also be now-relative.
A now-relative granule is a moving point on the time-line. It consists
of the variable now that represents the current time, and an
granule count that displaces the granule the specified distance
from the current time. For example, the now-relative granule
'now + 1 day' indicates that the Granule represented is whatever the
current time is displaced by one day in the future.
This class implements now-relative instants that
have a known, fixed displacement (as opposed to instants that have
indeterminate displacements).
Note that none of the operations are mutators, that is, they all
create a new instant if needed.
Granule,
TimeValue,
ExtendedBoolean,
Serialized Form| Field Summary |
| Fields inherited from class tauzaman.timestamp.Granule |
DETERMINATE, INDETERMINATE, NOWRELATIVE |
| Constructor Summary | |
NowRelativeGranule()
Create the now granule at the default Granularity (i.e., 'now + 0') |
|
NowRelativeGranule(Granularity g)
Create the now granule at the specified Granularity (i.e., 'now + 0') |
|
NowRelativeGranule(Granularity g,
long p)
Create a now-relative granule at the specified Granularity |
|
NowRelativeGranule(Granularity g,
TimeValue p)
Create a now-relative granule at the specified Granularity |
|
NowRelativeGranule(long p)
Create a now-relative granule at the default Granularity |
|
NowRelativeGranule(TimeValue p)
Create a now-relative granule at the default Granularity |
|
| Method Summary | |
NowRelativeGranule |
add(NowRelativeGranule other)
Add a now-relative to a now-relative. |
Granule |
decrement()
Construct a NowRelativeGranule that has the relative part decremented by 1 |
Granule |
divide(int n)
Divide by a constant. |
ExtendedBoolean |
equalTo(NowRelativeGranule other)
NowRelative/NowRelative comparison - Is this == other? |
TimeValue |
getGranule()
Accessor - retrieve the granule. |
TimeValue |
getLower()
Accessor - retrieve the lower bound from the now-relative granule. |
TimeValue |
getUpper()
Accessor - retrieve the upper bound from the now-relative granule. |
ExtendedBoolean |
greaterThan(NowRelativeGranule other)
NowRelative/NowRelative comparison - Is this > other? |
ExtendedBoolean |
greaterThanOrEqualTo(NowRelativeGranule other)
NowRelative/NowRelative comparison - Is this >= other? |
java.lang.String |
image()
Create a nice string image of a granule, alternative to toString() |
Granule |
increment()
Construct a NowRelativeGranule that has the relative part incremented by 1 |
ExtendedBoolean |
lessThan(NowRelativeGranule other)
NowRelative/NowRelative comparison - Is this < other? |
ExtendedBoolean |
lessThanOrEqualTo(NowRelativeGranule other)
NowRelative/NowRelative comparison - Is this <= other? |
Granule |
multiply(int n)
Multiply by a constant. |
Granule |
negate()
Negate the granule. |
NowRelativeGranule |
subtract(NowRelativeGranule other)
Subtract a now-relative from a now-relative. |
| Methods inherited from class tauzaman.timestamp.Granule |
add, equalTo, getGranularity, getKind, greaterThan, greaterThanOrEqualTo, lessThan, lessThanOrEqualTo, main, subtract |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public NowRelativeGranule()
throws TauZamanException
TauZamanException - if any abnormal condition occurs when
setting this Granule's default Granularitypublic NowRelativeGranule(Granularity g)
g - - desired Granularity
public NowRelativeGranule(TimeValue p)
throws TauZamanException
p - - displacement from now
TauZamanException - if any abnormal condition occurs when
setting this Granule's default Granularity
public NowRelativeGranule(Granularity g,
TimeValue p)
g - - desired Granularityp - - displacement from now
public NowRelativeGranule(long p)
throws TauZamanException
p - - count of granules
TauZamanException - if any abnormal condition occurs when
setting this Granule's default Granularity
public NowRelativeGranule(Granularity g,
long p)
g - - desired Granularityp - - count of granules| Method Detail |
public TimeValue getGranule()
getGranule in class Granulepublic TimeValue getLower()
getLower in class Granulepublic TimeValue getUpper()
getUpper in class Granulepublic java.lang.String image()
image in class Granulepublic Granule decrement()
decrement in class Granulepublic Granule increment()
increment in class Granulepublic Granule negate()
negate in class Granulepublic ExtendedBoolean equalTo(NowRelativeGranule other)
other - - The NowRelativeGranule to compare
public ExtendedBoolean lessThan(NowRelativeGranule other)
other - - The NowRelativeGranule to compare
public ExtendedBoolean lessThanOrEqualTo(NowRelativeGranule other)
other - - The NowRelativeGranule to compare
public ExtendedBoolean greaterThan(NowRelativeGranule other)
other - - The NowRelativeGranule to compare
public ExtendedBoolean greaterThanOrEqualTo(NowRelativeGranule other)
other - - The NowRelativeGranule to compare
public NowRelativeGranule add(NowRelativeGranule other)
other - - The NowRelativeGranule to add
return this + otherpublic NowRelativeGranule subtract(NowRelativeGranule other)
other - - The NowRelativeGranule to subtract
return this - otherpublic Granule multiply(int n)
multiply in class Granulen - - The multiplier
public Granule divide(int n)
divide in class Granulen - - The divisor
|
tauZaman v0.1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||