com.bloomberglp.blpapi
Class Constant

java.lang.Object
  extended by com.bloomberglp.blpapi.Constant

public abstract class Constant
extends java.lang.Object

Represents a constant value in the schema. Constants can be any of the following DataTypes: BOOL, CHAR, BYTE, INT32, INT64, FLOAT32, FLOAT64, STRING, DATE, TIME, DATETIME. As well as the constants value this class also provides access to the symbolic name, description and status of the constant. Constants are read-only and always created by the API, never by the application.

Author:
Chao Yao(cyao3)

Constructor Summary
Constant()
           
 
Method Summary
abstract  Schema.Datatype datatype()
          Return the Datatype used to represent the value of this Constant
abstract  java.lang.String description()
          Returns a String containing a human readable description of this Constant
abstract  char getValueAsChar()
          Return the value of this Constant as a char if it can be converted
abstract  Datetime getValueAsDate()
          Deprecated. since 3.2.1 Use getValueAsDatetime() instead
abstract  Datetime getValueAsDatetime()
          Return the value of this Constant as a Datetime if it can be converted
abstract  float getValueAsFloat32()
          Return the value of this Constant as a Float32 if it can be converted
abstract  double getValueAsFloat64()
          Return the value of this Constant as a Float64 if it can be converted
abstract  int getValueAsInt32()
          Return the value of this Constant as an Int32 if it can be converted
abstract  long getValueAsInt64()
          Return the value of this Constant as an Int64 if it can be converted
abstract  java.lang.String getValueAsString()
          Return the value of this Constant as a String if it can be converted
abstract  Datetime getValueAsTime()
          Deprecated. since 3.2.1 Use getValueAsDatetime() instead
abstract  Name name()
          Returns the symbolic name of the constant
abstract  void setUserData(java.lang.Object userData)
          Set the user data associated with this Constant to the specified userData.
abstract  Schema.Status status()
          Returns the status of this Constant
abstract  java.lang.Object userData()
          Returns the user data associated with this Constant.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Constant

public Constant()
Method Detail

setUserData

public abstract void setUserData(java.lang.Object userData)
Set the user data associated with this Constant to the specified userData.

Parameters:
userData - user provided data that is to be associated with this ConstantsList

name

public abstract Name name()
Returns the symbolic name of the constant


description

public abstract java.lang.String description()
Returns a String containing a human readable description of this Constant


status

public abstract Schema.Status status()
Returns the status of this Constant

See Also:
Schema.Status

datatype

public abstract Schema.Datatype datatype()
Return the Datatype used to represent the value of this Constant


getValueAsChar

public abstract char getValueAsChar()
Return the value of this Constant as a char if it can be converted

Throws:
InvalidConversionException - if the value of this Constant cannot be converted to a char

getValueAsInt32

public abstract int getValueAsInt32()
Return the value of this Constant as an Int32 if it can be converted

Throws:
InvalidConversionException - if the value of this Constant cannot be converted to an Int32

getValueAsInt64

public abstract long getValueAsInt64()
Return the value of this Constant as an Int64 if it can be converted

Throws:
InvalidConversionException - if the value of this Constant cannot be converted to an Int64

getValueAsFloat32

public abstract float getValueAsFloat32()
Return the value of this Constant as a Float32 if it can be converted

Throws:
InvalidConversionException - if the value of this Constant cannot be converted to a Float32

getValueAsFloat64

public abstract double getValueAsFloat64()
Return the value of this Constant as a Float64 if it can be converted

Throws:
InvalidConversionException - if the value of this Constant cannot be converted to a Float64

getValueAsString

public abstract java.lang.String getValueAsString()
Return the value of this Constant as a String if it can be converted

Throws:
InvalidConversionException - if the value of this Constant cannot be converted to a String

getValueAsDatetime

public abstract Datetime getValueAsDatetime()
Return the value of this Constant as a Datetime if it can be converted

Throws:
InvalidConversionException - if the value of this Constant cannot be converted to a Datetime

getValueAsDate

public abstract Datetime getValueAsDate()
Deprecated. since 3.2.1 Use getValueAsDatetime() instead


getValueAsTime

public abstract Datetime getValueAsTime()
Deprecated. since 3.2.1 Use getValueAsDatetime() instead


userData

public abstract java.lang.Object userData()
Returns the user data associated with this Constant. If setUserData(Object) has never been called for this Constant then return null



Copyright © 2015 Bloomberg L.P.. All Rights Reserved.