org.neo4j.kernel.impl.nioneo.store
Enum ShortString

java.lang.Object
  extended by java.lang.Enum<ShortString>
      extended by org.neo4j.kernel.impl.nioneo.store.ShortString
All Implemented Interfaces:
Serializable, Comparable<ShortString>

public enum ShortString
extends Enum<ShortString>

Supports encoding alphanumerical and SP . - + , ' : / _

Author:
Tobias Ivarsson

Enum Constant Summary
ALPHANUM
          Alpha-numerical characters space and underscore.
EUROPEAN
          The most common European characters (latin-1 but with less punctuation).
LOWER
          Lower-case characters with punctuation.
NUMERICAL
          Binary coded decimal with punctuation.
UPPER
          Upper-case characters with punctuation.
 
Method Summary
static String decode(long data)
          Decode a short string represented as a long
static boolean encode(int keyId, String string, PropertyRecord target)
          Encodes a short string.
static void main(String[] args)
           
static ShortString valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ShortString[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NUMERICAL

public static final ShortString NUMERICAL
Binary coded decimal with punctuation.
 HEADER (binary): 0000 LENG DATA... (0-14 chars) [4bit data]
 HEADER (binary): 0001 DATA... (15 chars) [4bit data]

    -0 -1 -2 -3 -4 -5 -6 -7   -8 -9 -A -B -C -D -E -F
 0-  0  1  2  3  4  5  6  7    8  9  +  ,  ' SP  .  -
 


UPPER

public static final ShortString UPPER
Upper-case characters with punctuation.
 HEADER (binary): 0010 LENG DATA... (0-11 chars) [5bit data]
 HEADER (binary): 0011 DATA... (12 chars) [5bit data]

    -0 -1 -2 -3 -4 -5 -6 -7   -8 -9 -A -B -C -D -E -F
 0- SP  A  B  C  D  E  F  G    H  I  J  K  L  M  N  O
 1-  P  Q  R  S  T  U  V  W    X  Y  Z  _  .  -  :  /
 


LOWER

public static final ShortString LOWER
Lower-case characters with punctuation.
 HEADER (binary): 0100 LENG DATA... (0-11 chars) [5bit data]
 HEADER (binary): 0101 DATA... (12 chars) [5bit data]

    -0 -1 -2 -3 -4 -5 -6 -7   -8 -9 -A -B -C -D -E -F
 0- SP  a  b  c  d  e  f  g    h  i  j  k  l  m  n  o
 1-  p  q  r  s  t  u  v  w    x  y  z  _  .  -  :  /
 


ALPHANUM

public static final ShortString ALPHANUM
Alpha-numerical characters space and underscore. HEADER (binary): 0110 LENG DATA... (10 chars) [6bit data]
    -0 -1 -2 -3 -4 -5 -6 -7   -8 -9 -A -B -C -D -E -F
 0- SP  A  B  C  D  E  F  G    H  I  J  K  L  M  N  O
 1-  P  Q  R  S  T  U  V  W    X  Y  Z  0  1  2  3  4
 2-  _  a  b  c  d  e  f  g    h  i  j  k  l  m  n  o
 3-  p  q  r  s  t  u  v  w    x  y  z  5  6  7  8  9
 


EUROPEAN

public static final ShortString EUROPEAN
The most common European characters (latin-1 but with less punctuation).
 HEADER (binary): 0111 0LEN DATA... (1-8 chars) [7bit data]
 HEADER (binary): 1DATA... (9 chars) [7bit data]

    -0 -1 -2 -3 -4 -5 -6 -7   -8 -9 -A -B -C -D -E -F
 0-  À  Á  Â  Ã  Ä  Å  Æ  Ç    È  É  Ê  Ë  Ì  Í  Î  Ï
 1-  Ð  Ñ  Ò  Ó  Ô  Õ  Ö  .    Ø  Ù  Ú  Û  Ü  Ý  Þ  ß
 2-  à  á  â  ã  ä  å  æ  ç    è  é  ê  ë  ì  í  î  ï
 3-  ð  ñ  ò  ó  ô  õ  ö  -    ø  ù  ú  û  ü  ý  þ  ÿ
 4- SP  A  B  C  D  E  F  G    H  I  J  K  L  M  N  O
 5-  P  Q  R  S  T  U  V  W    X  Y  Z  0  1  2  3  4
 6-  _  a  b  c  d  e  f  g    h  i  j  k  l  m  n  o
 7-  p  q  r  s  t  u  v  w    x  y  z  5  6  7  8  9
 

Method Detail

values

public static ShortString[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ShortString c : ShortString.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ShortString valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

main

public static void main(String[] args)

encode

public static boolean encode(int keyId,
                             String string,
                             PropertyRecord target)
Encodes a short string.

Parameters:
string - the string to encode.
target - the property record to store the encoded string in
Returns:
true if the string could be encoded as a short string, false if it couldn't.

decode

public static String decode(long data)
Decode a short string represented as a long

Parameters:
data - the value to decode to a short string.
Returns:
the decoded short string


Copyright © 2002-2012 The Neo4j Graph Database Project. All Rights Reserved.