dxFeed .Net API  5.13.0
dxFeed .Net API library intended to provide market data access for DX clients
Static Public Member Functions | Private Member Functions | Static Private Member Functions | Static Private Attributes
com.dxfeed.api.events.market.MarketEventSymbols Class Reference

Helper class to compose and parse symbols for market events. More...

Static Public Member Functions

static bool HasExchangeCode (string symbol)
 Returns true is the specified symbol has the exchange code specification. The result is false if symbol is null. More...
 
static char GetExchangeCode (string symbol)
 Returns exchange code of the specified symbol or `'\0'if none is defined. The result is'\0'if symbol isnull`. More...
 
static string ChangeExchangeCode (string symbol, char exchangeCode)
 Changes exchange code of the specified symbol or removes it if new exchange code is `'\0'. The result isnullif old symbol isnull`. More...
 
static string GetBaseSymbol (string symbol)
 Returns base symbol without exchange code and attributes. The result is null if symbol is null. More...
 
static string ChangeBaseSymbol (string symbol, string baseSymbol)
 Changes base symbol while leaving exchange code and attributes intact. The result is null if old symbol is null. More...
 
static bool HasAttributes (string symbol)
 Returns true if the specified symbol has any attributes. More...
 
static string GetAttributeStringByKey (string symbol, string key)
 Returns value of the attribute with the specified key. The result is null if attribute with the specified key is not found. The result is null if symbol is null. More...
 
static string ChangeAttributeStringByKey (string symbol, string key, string value)
 Changes value of one attribute value while leaving exchange code and other attributes intact. The null symbol is interpreted as empty one by this method.. More...
 
static string RemoveAttributeStringByKey (string symbol, string key)
 Removes one attribute with the specified key while leaving exchange code and other attributes intact. The result is null if symbol is null. More...
 
static void ValidateSymbol (object symbolObj)
 Validates symbolObj is not null and is string or CandleSymbol object. More...
 

Private Member Functions

 MarketEventSymbols ()
 

Static Private Member Functions

static bool HasExchangeCodeInternal (string symbol, int length)
 
static string GetBaseSymbolInternal (string symbol, int length)
 
static bool HasAttributesInternal (string symbol, int length)
 
static int GetLengthWithoutAttributesInternal (string symbol)
 
static string GetKeyInternal (string symbol, int i)
 
static int GetNextKeyInternal (string symbol, int i)
 
static string GetValueInternal (string symbol, int i, int j)
 
static string DropKeyAndValueInternal (string symbol, int length, int i, int j)
 
static string GetAttributeInternal (string symbol, int length, string key)
 
static string RemoveAttributeInternal (string symbol, int length, string key)
 
static string AddAttributeInternal (string symbol, int length, string key, string value)
 

Static Private Attributes

static readonly char EXCHANGE_SEPARATOR = '&'
 
static readonly char ATTRIBUTES_OPEN = '{'
 
static readonly char ATTRIBUTES_CLOSE = '}'
 
static readonly char ATTRIBUTES_SEPARATOR = ','
 
static readonly char ATTRIBUTE_VALUE = '='
 

Detailed Description

Helper class to compose and parse symbols for market events.

Regional symbols

Regional symbol subscription receives events only from a designated exchange, marketplace, or venue instead of receiving composite events from all venues (by default). Regional symbol is composed from a base symbol, ampersand character ('&'), and an exchange code character. For example,

Symbol attributes

Market event symbols can have a number of attributes attached to then in curly braces with <key>=<value> paris separated by commas. For example,

The methods in this class always maintain attribute keys in alphabetic order.

Constructor & Destructor Documentation

◆ MarketEventSymbols()

com.dxfeed.api.events.market.MarketEventSymbols.MarketEventSymbols ( )
inlineprivate

Member Function Documentation

◆ AddAttributeInternal()

static string com.dxfeed.api.events.market.MarketEventSymbols.AddAttributeInternal ( string  symbol,
int  length,
string  key,
string  value 
)
inlinestaticprivate

◆ ChangeAttributeStringByKey()

static string com.dxfeed.api.events.market.MarketEventSymbols.ChangeAttributeStringByKey ( string  symbol,
string  key,
string  value 
)
inlinestatic

Changes value of one attribute value while leaving exchange code and other attributes intact. The null symbol is interpreted as empty one by this method..

Parameters
symbolold symbol
keyattribute key
valueattribute value
Returns
new symbol with key attribute with the specified value and everything else from the old symbol.

///

Exceptions
ArgumentNullException

◆ ChangeBaseSymbol()

static string com.dxfeed.api.events.market.MarketEventSymbols.ChangeBaseSymbol ( string  symbol,
string  baseSymbol 
)
inlinestatic

Changes base symbol while leaving exchange code and attributes intact. The result is null if old symbol is null.

Parameters
symbolold symbol
baseSymbolnew base symbol.
Returns
new symbol with new base symbol and old symbol's exchange code and attributes.

◆ ChangeExchangeCode()

static string com.dxfeed.api.events.market.MarketEventSymbols.ChangeExchangeCode ( string  symbol,
char  exchangeCode 
)
inlinestatic

Changes exchange code of the specified symbol or removes it if new exchange code is `'\0'. The result isnullif old symbol isnull`.

Parameters
symbolold symbol.
exchangeCodenew exchange code.
Returns
new symbol with the changed exchange code.

◆ DropKeyAndValueInternal()

static string com.dxfeed.api.events.market.MarketEventSymbols.DropKeyAndValueInternal ( string  symbol,
int  length,
int  i,
int  j 
)
inlinestaticprivate

◆ GetAttributeInternal()

static string com.dxfeed.api.events.market.MarketEventSymbols.GetAttributeInternal ( string  symbol,
int  length,
string  key 
)
inlinestaticprivate

◆ GetAttributeStringByKey()

static string com.dxfeed.api.events.market.MarketEventSymbols.GetAttributeStringByKey ( string  symbol,
string  key 
)
inlinestatic

Returns value of the attribute with the specified key. The result is null if attribute with the specified key is not found. The result is null if symbol is null.

Parameters
symbolsymbol
keyattribute key
Returns
value of the attribute with the specified key

///

Exceptions
ArgumentNullException

◆ GetBaseSymbol()

static string com.dxfeed.api.events.market.MarketEventSymbols.GetBaseSymbol ( string  symbol)
inlinestatic

Returns base symbol without exchange code and attributes. The result is null if symbol is null.

Parameters
symbolsymbol
Returns
base symbol without exchange code and attributes.

◆ GetBaseSymbolInternal()

static string com.dxfeed.api.events.market.MarketEventSymbols.GetBaseSymbolInternal ( string  symbol,
int  length 
)
inlinestaticprivate

◆ GetExchangeCode()

static char com.dxfeed.api.events.market.MarketEventSymbols.GetExchangeCode ( string  symbol)
inlinestatic

Returns exchange code of the specified symbol or `'\0'if none is defined. The result is'\0'if symbol isnull`.

Parameters
symbolsymbol
Returns
exchange code of the specified symbol or `'\0'` if none is defined.

◆ GetKeyInternal()

static string com.dxfeed.api.events.market.MarketEventSymbols.GetKeyInternal ( string  symbol,
int  i 
)
inlinestaticprivate

◆ GetLengthWithoutAttributesInternal()

static int com.dxfeed.api.events.market.MarketEventSymbols.GetLengthWithoutAttributesInternal ( string  symbol)
inlinestaticprivate

◆ GetNextKeyInternal()

static int com.dxfeed.api.events.market.MarketEventSymbols.GetNextKeyInternal ( string  symbol,
int  i 
)
inlinestaticprivate

◆ GetValueInternal()

static string com.dxfeed.api.events.market.MarketEventSymbols.GetValueInternal ( string  symbol,
int  i,
int  j 
)
inlinestaticprivate

◆ HasAttributes()

static bool com.dxfeed.api.events.market.MarketEventSymbols.HasAttributes ( string  symbol)
inlinestatic

Returns true if the specified symbol has any attributes.

Parameters
symbol
Returns

◆ HasAttributesInternal()

static bool com.dxfeed.api.events.market.MarketEventSymbols.HasAttributesInternal ( string  symbol,
int  length 
)
inlinestaticprivate

◆ HasExchangeCode()

static bool com.dxfeed.api.events.market.MarketEventSymbols.HasExchangeCode ( string  symbol)
inlinestatic

Returns true is the specified symbol has the exchange code specification. The result is false if symbol is null.

Parameters
symbolsymbol
Returns
true is the specified symbol has the exchange code specification.

◆ HasExchangeCodeInternal()

static bool com.dxfeed.api.events.market.MarketEventSymbols.HasExchangeCodeInternal ( string  symbol,
int  length 
)
inlinestaticprivate

◆ RemoveAttributeInternal()

static string com.dxfeed.api.events.market.MarketEventSymbols.RemoveAttributeInternal ( string  symbol,
int  length,
string  key 
)
inlinestaticprivate

◆ RemoveAttributeStringByKey()

static string com.dxfeed.api.events.market.MarketEventSymbols.RemoveAttributeStringByKey ( string  symbol,
string  key 
)
inlinestatic

Removes one attribute with the specified key while leaving exchange code and other attributes intact. The result is null if symbol is null.

Parameters
symbolold symbol
keyattribute key
Returns
new symbol without the specified key and everything else from the old symbol.
Exceptions
ArgumentNullException

◆ ValidateSymbol()

static void com.dxfeed.api.events.market.MarketEventSymbols.ValidateSymbol ( object  symbolObj)
inlinestatic

Validates symbolObj is not null and is string or CandleSymbol object.

Parameters
symbolObjObject to validate for symbol.
Exceptions
ArgumentExceptionThe symbolObj is not one of string or CandleSymbol.
ArgumentNullExceptionThe symbolObj is null.

Field Documentation

◆ ATTRIBUTE_VALUE

readonly char com.dxfeed.api.events.market.MarketEventSymbols.ATTRIBUTE_VALUE = '='
staticprivate

◆ ATTRIBUTES_CLOSE

readonly char com.dxfeed.api.events.market.MarketEventSymbols.ATTRIBUTES_CLOSE = '}'
staticprivate

◆ ATTRIBUTES_OPEN

readonly char com.dxfeed.api.events.market.MarketEventSymbols.ATTRIBUTES_OPEN = '{'
staticprivate

◆ ATTRIBUTES_SEPARATOR

readonly char com.dxfeed.api.events.market.MarketEventSymbols.ATTRIBUTES_SEPARATOR = ','
staticprivate

◆ EXCHANGE_SEPARATOR

readonly char com.dxfeed.api.events.market.MarketEventSymbols.EXCHANGE_SEPARATOR = '&'
staticprivate

The documentation for this class was generated from the following file: