|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dukascopy.api.Period
public final class Period
Represents periods of bars. This class is used as enum in java 1.5 and later, but defined as class to allow creation of custom period.
Field Summary | |
---|---|
static Period |
DAILY
|
static Period |
FIFTEEN_MINS
|
static Period |
FIVE_MINS
|
static Period |
FOUR_HOURS
|
long |
interval
Time interval in milliseconds |
static Period |
MONTHLY
|
int |
numOfUnits
Number of time units |
static Period |
ONE_HOUR
|
static Period |
ONE_MIN
|
static Period |
ONE_SEC
|
static Period |
ONE_YEAR
|
static Period |
TEN_MINS
|
static Period |
TEN_SECS
|
static Period |
THIRTY_MINS
|
static Period |
THIRTY_SECS
|
static Period |
TICK
Defines period of tick. |
static Period |
TWENTY_MINS
|
static Period |
TWENTY_SECS
|
static Period |
TWO_SECS
|
Unit |
unit
Time unit |
static Period |
WEEKLY
|
Constructor Summary | |
---|---|
Period(Unit unit,
int nUnits)
Creates custom period |
Method Summary | |
---|---|
Object |
clone()
Throws CloneNotSupportedException |
int |
compareTo(Period another)
Compares periods, but instead of using ordinal like enums, uses interval |
boolean |
equals(Object other)
|
long |
getInterval()
Returns interval in milliseconds. |
int |
getNumOfUnits()
Returns number of units. |
Unit |
getUnit()
Returns time unit. |
int |
hashCode()
|
boolean |
isSmallerThan(Period period)
Checks whether this periods time interval is smaller than the one of period |
String |
name()
Name of predefined constant exactly how it was defined or null if it's custom period |
int |
ordinal()
|
String |
toString()
|
static Period |
valueOf(String name)
Returns one of the predefined periods with specified name. |
static Period[] |
values()
Returns array of predefined periods |
static Period[] |
valuesForIndicator()
Returns array of predefined periods applicable to indicators |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Period TICK
public static final Period ONE_SEC
public static final Period TWO_SECS
public static final Period TEN_SECS
public static final Period TWENTY_SECS
public static final Period THIRTY_SECS
public static final Period ONE_MIN
public static final Period FIVE_MINS
public static final Period TEN_MINS
public static final Period FIFTEEN_MINS
public static final Period TWENTY_MINS
public static final Period THIRTY_MINS
public static final Period ONE_HOUR
public static final Period FOUR_HOURS
public static final Period DAILY
public static final Period WEEKLY
public static final Period MONTHLY
public static final Period ONE_YEAR
public final Unit unit
public final int numOfUnits
public final long interval
Constructor Detail |
---|
public Period(Unit unit, int nUnits)
unit
- time unitnUnits
- number of time unitsMethod Detail |
---|
public final Unit getUnit()
public final int getNumOfUnits()
public final long getInterval()
(long) (365.24 * 24 * 60 * 60 * 1000L)
public final boolean equals(Object other)
equals
in class Object
public final Object clone() throws CloneNotSupportedException
CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public final int compareTo(Period another)
compareTo
in interface Comparable<Period>
public final int hashCode()
hashCode
in class Object
public final String toString()
toString
in class Object
public int ordinal()
public String name()
public static final Period valueOf(String name)
name
- name of the period constant, exactly how it defined
public static final Period[] values()
public static final Period[] valuesForIndicator()
public boolean isSmallerThan(Period period)
period
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |