|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.zib.scalaris.ErlangValue
de.zib.scalaris.examples.ErlangValueFastString
public class ErlangValueFastString
Implements a faster 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
Nested Class Summary |
---|
Nested classes/interfaces inherited from class de.zib.scalaris.ErlangValue |
---|
ErlangValue.ListElementConverter<T>, ErlangValue.StringListElementConverter |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
String |
stringValue()
Converts the stored erlang value created by this object to a Java String . |
Methods inherited from class de.zib.scalaris.ErlangValue |
---|
bigIntValue, binaryListValue, binaryValue, boolValue, compareTo, convertToErlang, doubleListValue, doubleValue, equals, hashCode, intValue, jsonListValue, jsonValue, jsonValue, listCollectionValue, listCollectionValue, listValue, listValue, longListValue, longValue, otpObjectToOtpList, stringListValue, toString, value |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ErlangValueFastString(String value)
value
- the value to usepublic ErlangValueFastString(OtpErlangObject otpValue)
otpValue
- the value to usepublic ErlangValueFastString(ErlangValue value)
value
- the value to useErlangValue
Method Detail |
---|
public String stringValue()
String
.
stringValue
in class ErlangValue
ClassCastException
- if the conversion fails
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |