Package deltix.qsrv.hf.pub
Class ExchangeCodec
- java.lang.Object
-
- deltix.qsrv.hf.pub.ExchangeCodec
-
public abstract class ExchangeCodec extends java.lang.Object
Utility class provides methods to convert exchange code from string to long and vice versa.Methods are thread-safe and
longToCode(long)
caches strings internally to optimise string allocations. From the other side, synchronized methods may be too slow for scenarios, when they are used frequently. Consider using ofAlphanumericCodec
instance in this case.If you not sure a name is less or equal to 10 characters and all of the characters are uppercase, use
codeToLongSafely(java.lang.String)
. It truncates the name if its length is more than 10 characters and converts the name to uppercase. For example, the name "GoldmanSachs" will be converted to "GOLDMANSAC" before encoded.
-
-
Constructor Summary
Constructors Constructor Description ExchangeCodec()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static long
codeToLong(java.lang.CharSequence code)
static long
codeToLong(java.lang.String code)
static long
codeToLongSafely(java.lang.CharSequence code)
static long
codeToLongSafely(java.lang.String code)
static java.lang.String
longToCode(long n)
-
-
-
Field Detail
-
NULL
public static final long NULL
- See Also:
- Constant Field Values
-
MAX_LEN
public static final int MAX_LEN
- See Also:
- Constant Field Values
-
-
Method Detail
-
longToCode
public static java.lang.String longToCode(long n)
-
codeToLong
public static long codeToLong(java.lang.String code)
-
codeToLong
public static long codeToLong(java.lang.CharSequence code)
-
codeToLongSafely
public static long codeToLongSafely(java.lang.String code)
-
codeToLongSafely
public static long codeToLongSafely(java.lang.CharSequence code)
-
-