|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Object java.lang.Enum<SimpleGranularity> com.dlsc.flexgantt.model.SimpleGranularity
public enum SimpleGranularity
An enumeration of possible simple granularities. The values in this
enumerator are called simple because of their lack of complexity compared to
the TimeGranularity
enumerator. A simple enumerator value represents
an order of 10 (1, 10, 100, 1000, 10000, 100000, ....). The documentation
within this class uses the term milliseconds but the numbers could as
well be called units or steps. If an application performs
scheduling tasks that are based on units and steps instead of real time
then it could easily use this enumerator.
SimpleGranularityDatelineModel
,
SimpleGranularityDatelineRenderer
,
SimpleGranularityGridPolicy
Enum Constant Summary | |
---|---|
BILLION
A granularity representing one billion milliseconds. |
|
BILLION_HUNDRED
A granularity representing one hundred billion milliseconds. |
|
BILLION_TEN
A granularity representing ten billion milliseconds. |
|
HUNDRED
A granularity representing one hundred milliseconds. |
|
MILLION
A granularity representing one million milliseconds. |
|
MILLION_HUNDRED
A granularity representing one hundred million milliseconds. |
|
MILLION_TEN
A granularity representing ten million milliseconds. |
|
ONE
A granularity representing one millisecond. |
|
TEN
A granularity representing ten milliseconds. |
|
THOUSAND
A granularity representing one thousand milliseconds. |
|
THOUSAND_HUNDRED
A granularity representing one hundred thousand milliseconds. |
|
THOUSAND_TEN
A granularity representing ten thousand milliseconds. |
|
TRILLION
A granularity representing one trillion milliseconds. |
Method Summary | |
---|---|
long |
adjust(long time)
Adjusts the given time point by rounding it down to the nearest multitude of the milliseconds represented by the granularity value. |
long |
decrement(long time)
Decrements the given number of milliseconds with the milliseconds represented by the enumerator value. |
double |
getDelta(ITimeSpan span)
Calculates how often the number of milliseconds represented by the time granularity fits into the difference between the given start and end times: (endTime - startTime) / millis . |
long |
getMillis()
Returns the number of milliseconds represented by the granularity. |
java.lang.String |
getName()
Returns the name of the granularity. |
long |
increment(long time)
Increments the given number of milliseconds with the milliseconds represented by the enumerator value. |
boolean |
isLarger(SimpleGranularity sg)
Checks whether this granularity is considered to be larger than the given one. |
boolean |
isSmaller(SimpleGranularity sg)
Checks whether this granularity is considered to be smaller than the given one. |
SimpleGranularity |
next()
Returns the next larger granularity (example: ONE -> TEN -> HUNDRED). |
SimpleGranularity |
previous()
Returns the previous smaller granularity (example: HUNDRED -> TEN -> ONE). |
static SimpleGranularity |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static SimpleGranularity[] |
values()
Returns an array containing the constants of this enum type, in the order they're declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final SimpleGranularity ONE
public static final SimpleGranularity TEN
public static final SimpleGranularity HUNDRED
public static final SimpleGranularity THOUSAND
public static final SimpleGranularity THOUSAND_TEN
public static final SimpleGranularity THOUSAND_HUNDRED
public static final SimpleGranularity MILLION
public static final SimpleGranularity MILLION_TEN
public static final SimpleGranularity MILLION_HUNDRED
public static final SimpleGranularity BILLION
public static final SimpleGranularity BILLION_TEN
public static final SimpleGranularity BILLION_HUNDRED
public static final SimpleGranularity TRILLION
Method Detail |
---|
public static final SimpleGranularity[] values()
for(SimpleGranularity c : SimpleGranularity.values()) System.out.println(c);
public static SimpleGranularity valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified namepublic java.lang.String getName()
IGranularity
getName
in interface IGranularity<SimpleGranularity>
public long increment(long time)
time
- the time to increment
public long decrement(long time)
time
- the time to increment
public long adjust(long time)
THOUSAND
would adjust the time point 4366 to 4000.
time
- the time that needs adjustment
public long getMillis()
public double getDelta(ITimeSpan span)
(endTime - startTime) / millis
.
span
- the time span for which to return the delta
public SimpleGranularity next()
public SimpleGranularity previous()
public boolean isSmaller(SimpleGranularity sg)
SimpleGranularity.THOUSAND.isSmaller(SimpleGranularity.HUNDRED)
would return FALSE since one thousand milliseconds is a larger
number than one hundred milliseconds.
isSmaller
in interface IGranularity<SimpleGranularity>
sg
- the granularity to compare with
public boolean isLarger(SimpleGranularity sg)
SimpleGranularity.THOUSAND.isLarger(SimpleGranularity.HUNDRED)
would return TRUE since one thousand milliseconds is a larger number
than one hundred milliseconds.
isLarger
in interface IGranularity<SimpleGranularity>
sg
- the granularity to compare with
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |