public class MarketEventSymbols extends Object
<key>=<value>
paris separated by commas. For example,
Modifier and Type | Method and Description |
---|---|
static String |
buildSpreadSymbol(Map<String,? extends Number> spread)
Builds canonical spread symbol for specified spread components.
|
static String |
changeAttributeStringByKey(String symbol,
String key,
String value)
Changes value of one attribute value while leaving exchange code and other attributes intact.
|
static String |
changeBaseSymbol(String symbol,
String baseSymbol)
Changes base symbol while leaving exchange code and attributes intact.
|
static String |
changeExchangeCode(String symbol,
char exchangeCode)
Changes exchange code of the specified symbol or removes it
if new exchange code is
'\0' . |
static String |
getAttributeStringByKey(String symbol,
String key)
Returns value of the attribute with the specified key.
|
static String |
getBaseSymbol(String symbol)
Returns base symbol without exchange code and attributes.
|
static char |
getExchangeCode(String symbol)
Returns exchange code of the specified symbol or
'\0' if none is defined. |
static boolean |
hasAttributes(String symbol)
Returns true if the specified symbol has any attributes.
|
static boolean |
hasExchangeCode(String symbol)
Returns
true is the specified symbol has the exchange code specification. |
static String |
removeAttributeStringByKey(String symbol,
String key)
Removes one attribute with the specified key while leaving exchange code and other attributes intact.
|
public static boolean hasExchangeCode(String symbol)
true
is the specified symbol has the exchange code specification.
The result is false
if symbol is null
.symbol
- symbol.true
is the specified symbol has the exchange code specification.public static char getExchangeCode(String symbol)
'\0'
if none is defined.
The result is '\0'
if symbol is null
.symbol
- symbol.'\0'
if none is defined.public static String changeExchangeCode(String symbol, char exchangeCode)
'\0'
.
The result is null
if old symbol is null
.symbol
- old symbol.exchangeCode
- new exchange code.public static String getBaseSymbol(String symbol)
null
if symbol is null
.symbol
- symbol.public static String changeBaseSymbol(String symbol, String baseSymbol)
null
if old symbol is null
.symbol
- old symbol.baseSymbol
- new base symbol.public static boolean hasAttributes(String symbol)
public static String getAttributeStringByKey(String symbol, String key)
null
if attribute with the specified key is not found.
The result is null
if symbol is null
.symbol
- symbol.key
- attribute key.NullPointerException
- if key is null
.public static String changeAttributeStringByKey(String symbol, String key, String value)
null
symbol is interpreted as empty one by this method..symbol
- old symbol.key
- attribute key.value
- attribute value.NullPointerException
- if key is null
.public static String removeAttributeStringByKey(String symbol, String key)
null
if symbol is null
.symbol
- old symbol.key
- attribute key.NullPointerException
- if key is null
.public static String buildSpreadSymbol(Map<String,? extends Number> spread)
Spread legs with zero ratio are ignored (not included in the spread symbol). If spread is empty then empty string (with zero length) is returned. If spread consists of one leg with ratio of 1 then pure leg symbol is returned.
spread
- maps spread leg symbol to its ratio in the spreadCopyright © 2002–2023 Devexperts LLC. All rights reserved.