com.dxfeed.event.candle
Enum CandleType

java.lang.Object
  extended by java.lang.Enum<CandleType>
      extended by com.dxfeed.event.candle.CandleType
All Implemented Interfaces:
Serializable, Comparable<CandleType>

public enum CandleType
extends Enum<CandleType>

Type of the candle aggregation period constitutes CandlePeriod type together its actual value.


Enum Constant Summary
DAY
          Certain number of days.
HOUR
          Certain number of hours.
MINUTE
          Certain number of minutes.
MONTH
          Certain number of months.
OPTEXP
          Certain number of option expirations.
PRICE
          Certain price change.
SECOND
          Certain number of seconds.
TICK
          Certain number of ticks.
VOLUME
          Certain volume of trades.
WEEK
          Certain number of weeks.
YEAR
          Certain number of years.
 
Method Summary
 long getPeriodIntervalMillis()
          Returns candle type period in milliseconds as closely as possible.
static CandleType parse(String s)
          Parses string representation of candle type into object.
 String toString()
          Returns string representation of this candle type.
static CandleType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static CandleType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

TICK

public static final CandleType TICK
Certain number of ticks.


SECOND

public static final CandleType SECOND
Certain number of seconds.


MINUTE

public static final CandleType MINUTE
Certain number of minutes.


HOUR

public static final CandleType HOUR
Certain number of hours.


DAY

public static final CandleType DAY
Certain number of days.


WEEK

public static final CandleType WEEK
Certain number of weeks.


MONTH

public static final CandleType MONTH
Certain number of months.


OPTEXP

public static final CandleType OPTEXP
Certain number of option expirations.


YEAR

public static final CandleType YEAR
Certain number of years.


VOLUME

public static final CandleType VOLUME
Certain volume of trades.


PRICE

public static final CandleType PRICE
Certain price change.

Method Detail

values

public static CandleType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (CandleType c : CandleType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static CandleType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getPeriodIntervalMillis

public long getPeriodIntervalMillis()
Returns candle type period in milliseconds as closely as possible. Certain types like SECOND and DAY span a specific number of milliseconds. MONTH, OPTEXP and YEAR are approximate. Candle type period of TICK, VOLUME, and PRICE is not defined and this method returns 0.

Returns:
aggregation period in milliseconds.

toString

public String toString()
Returns string representation of this candle type. The string representation of candle type is the shortest unique prefix of the lower case string that corresponds to its name. For example, TICK is represented as "t", while MONTH is represented as "mo" to distinguish it from MINUTE that is represented as "m".

Overrides:
toString in class Enum<CandleType>
Returns:
string representation of this candle price type.

parse

public static CandleType parse(String s)
Parses string representation of candle type into object. Any string that that is a prefix of candle type Enum.name() can be parsed (including the one that was returned by toString()) and case is ignored for parsing.

Parameters:
s - string representation of candle type.
Returns:
candle type.
Throws:
IllegalArgumentException - if the string representation is invalid.


Copyright © 2013 Devexperts. All Rights Reserved.