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 | Description |
|---|---|
ErlangValueFastString(com.ericsson.otp.erlang.OtpErlangObject otpValue) |
Creates an object with the given (erlang) value.
|
ErlangValueFastString(ErlangValue value) |
Creates an object with the given (erlang) value.
|
ErlangValueFastString(java.lang.String value) |
Creates an object with the given (Java) value.
|
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.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(java.lang.String value)
value - the value to usepublic ErlangValueFastString(com.ericsson.otp.erlang.OtpErlangObject otpValue)
otpValue - the value to usepublic ErlangValueFastString(ErlangValue value)
value - the value to useErlangValuepublic java.lang.String stringValue()
String.stringValue in class ErlangValuejava.lang.ClassCastException - if the conversion fails