com.dukascopy.api
Enum Unit

java.lang.Object
  extended by java.lang.Enum<Unit>
      extended by com.dukascopy.api.Unit
All Implemented Interfaces:
Serializable, Comparable<Unit>

public enum Unit
extends Enum<Unit>

Defines time units

Author:
Dmitry Shohov

Enum Constant Summary
Day
           
Hour
           
Millisecond
           
Minute
           
Month
           
Second
           
Week
           
Year
           
 
Method Summary
 String getCompactDescription()
          Returns compact description
 long getInterval()
          Returns interval of time unit in milliseconds
 String getLongDescription()
          Returns long description
 String getShortDescription()
          Returns short description, usually one or two characters long
static Unit valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Unit[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

Millisecond

public static final Unit Millisecond

Second

public static final Unit Second

Minute

public static final Unit Minute

Hour

public static final Unit Hour

Day

public static final Unit Day

Week

public static final Unit Week

Month

public static final Unit Month

Year

public static final Unit Year
Method Detail

values

public static Unit[] 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 (Unit c : Unit.values())
    System.out.println(c);

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

valueOf

public static Unit 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

getInterval

public final long getInterval()
Returns interval of time unit in milliseconds

Returns:
interval of time unit in milliseconds

getShortDescription

public String getShortDescription()
Returns short description, usually one or two characters long

Returns:
short description

getCompactDescription

public String getCompactDescription()
Returns compact description

Returns:
compact description

getLongDescription

public String getLongDescription()
Returns long description

Returns:
long description


Copyright © 2009. All Rights Reserved.