public class ErlangValueFastString extends ErlangValue
String storage mechanism if only Java access to
scalaris is used.
Uses OtpErlangBinary objects that store the array of bytes a
String consists of and writes this binary to scalaris wrapped into a
OtpErlangTuple. Trying to read strings will convert a returned
OtpErlangBinary to a String or return the value of a
OtpErlangString result.
Run a benchmark of the different String implementations with
java -cp scalaris-examples.jar de.zib.scalaris.examples.FastStringBenchmark
ErlangValue.ListElementConverter<T>, ErlangValue.StringListElementConverter| Constructor and Description |
|---|
ErlangValueFastString(ErlangValue value)
Creates an object with the given (erlang) value.
|
ErlangValueFastString(OtpErlangObject otpValue)
Creates an object with the given (erlang) value.
|
ErlangValueFastString(String value)
Creates an object with the given (Java) value.
|
| Modifier and Type | Method and Description |
|---|---|
String |
stringValue()
Converts the stored erlang value created by this object to a Java
String. |
bigIntValue, binaryListValue, binaryValue, boolValue, compareTo, convertToErlang, doubleListValue, doubleValue, equals, hashCode, intValue, jsonListValue, jsonValue, jsonValue, listCollectionValue, listCollectionValue, listValue, listValue, longListValue, longValue, otpObjectToOtpList, stringListValue, toString, valuepublic ErlangValueFastString(String value)
value - the value to usepublic ErlangValueFastString(OtpErlangObject otpValue)
otpValue - the value to usepublic ErlangValueFastString(ErlangValue value)
value - the value to useErlangValuepublic String stringValue()
String.stringValue in class ErlangValueClassCastException - if the conversion fails