de.zib.scalaris.examples
Class ErlangValueBitString

java.lang.Object
  extended by de.zib.scalaris.ErlangValue
      extended by de.zib.scalaris.examples.ErlangValueBitString
All Implemented Interfaces:
Comparable<ErlangValue>

public class ErlangValueBitString
extends ErlangValue

Implements a faster String storage mechanism using erlang bitstrings.

Run a benchmark of the different String implementations with java -cp scalaris-examples.jar de.zib.scalaris.examples.FastStringBenchmark

Since:
2.9
Version:
2.9
Author:
Nico Kruber, kruber@zib.de

Nested Class Summary
 
Nested classes/interfaces inherited from class de.zib.scalaris.ErlangValue
ErlangValue.ListElementConverter<T>, ErlangValue.StringListElementConverter
 
Constructor Summary
ErlangValueBitString(ErlangValue value)
          Creates an object with the given (erlang) value.
ErlangValueBitString(OtpErlangObject otpValue)
          Creates an object with the given (erlang) value.
ErlangValueBitString(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

ErlangValueBitString

public ErlangValueBitString(String value)
Creates an object with the given (Java) value.

Parameters:
value - the value to use

ErlangValueBitString

public ErlangValueBitString(OtpErlangObject otpValue)
Creates an object with the given (erlang) value.

Parameters:
otpValue - the value to use

ErlangValueBitString

public ErlangValueBitString(ErlangValue value)
Creates an object with the given (erlang) value. Provided for convenience.

Parameters:
value - the value to use
See Also:
ErlangValue
Method Detail

stringValue

public String stringValue()
Converts the stored erlang value created by this object to a Java String.

Overrides:
stringValue in class ErlangValue
Returns:
the converted value
Throws:
ClassCastException - if the conversion fails