Class LongStringEncoder
java.lang.Object
com.semedy.reasoner.symboltable.encoder.LongStringEncoder
Util class for encoding long strings,
A long string gets an additional prefix
consisting of a hash code
A long string gets an additional prefix
consisting of a hash code
- Author:
- angele
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Decode string, i.e. throw prefix awaystatic String
Encode a string, i.e. if string is longer than maxLength
add hashcode at the beginningstatic String
encodeWithAphostrophe
(String s, int maxLength) Encode a string, i.e. if string is longer than maxLength
add hashcode at the beginning.
-
Constructor Details
-
LongStringEncoder
public LongStringEncoder()
-
-
Method Details
-
encode
Encode a string, i.e. if string is longer than maxLength
add hashcode at the beginning- Parameters:
s
- , stringmaxLength
- , if s is longer, encode it- Returns:
-
encodeWithAphostrophe
Encode a string, i.e. if string is longer than maxLength
add hashcode at the beginning. Add apostrophes- Parameters:
s
- , stringmaxLength
- , if s is longer, encode it- Returns:
-
decode
Decode string, i.e. throw prefix away- Parameters:
s
- , stringmaxLength
- , stirng is encoded only if longer- Returns:
-