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

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

public enum LongerShortString
extends Enum<LongerShortString>

Supports encoding alphanumerical and SP . - + , ' : / _ (This version assumes 14bytes property block, instead of 8bytes)

Author:
Tobias Ivarsson

Enum Constant Summary
ALPHANUM
          Alpha-numerical characters space and underscore.
ALPHASYM
          Alpha-numerical characters space and underscore.
DATE
          Binary coded decimal with punctuation.
EMAIL
          Lower-case characters with punctuation.
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.
URI
          Lower-case characters, digits and punctuation and symbols.
 
Method Summary
static int calculateNumberOfBlocksUsed(int encoding, int length)
           
static int calculateNumberOfBlocksUsed(long firstBlock)
           
static String decode(PropertyBlock block)
          Decode a short string represented as a long[]
static boolean encode(int keyId, String string, PropertyBlock target, int payloadSize)
          Encodes a short string.
static LongerShortString valueOf(String name)
          Returns the enum constant of this type with the specified name.
static LongerShortString[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
static boolean writeLatin1Characters(String string, Bits bits)
           
 
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 LongerShortString NUMERICAL
Binary coded decimal with punctuation.
    -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  .  -  +  ,  '
 


DATE

public static final LongerShortString DATE
Binary coded decimal with punctuation.
    -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 LongerShortString UPPER
Upper-case characters with punctuation.
    -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 LongerShortString LOWER
Lower-case characters with punctuation.
    -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  _  .  -  :  /
 


EMAIL

public static final LongerShortString EMAIL
Lower-case characters with punctuation.
    -0 -1 -2 -3 -4 -5 -6 -7   -8 -9 -A -B -C -D -E -F
 0-  ,  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  _  .  -  +  @
 


URI

public static final LongerShortString URI
Lower-case characters, digits and punctuation and symbols.
    -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
 2-  0  1  2  3  4  5  6  7    8  9  _  .  -  :  /  +
 3-  ,  '  @  |  ;  *  ?  &    %  #  (  )  $  <  >  =
 


ALPHANUM

public static final LongerShortString ALPHANUM
Alpha-numerical characters space and underscore.
    -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
 


ALPHASYM

public static final LongerShortString ALPHASYM
Alpha-numerical characters space and underscore.
    -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  _  .  -  :  /
 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  +  ,  '  @  |
 


EUROPEAN

public static final LongerShortString EUROPEAN
The most common European characters (latin-1 but with less punctuation).
    -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 LongerShortString[] 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 (LongerShortString c : LongerShortString.values())
    System.out.println(c);

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

valueOf

public static LongerShortString 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

encode

public static boolean encode(int keyId,
                             String string,
                             PropertyBlock target,
                             int payloadSize)
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(PropertyBlock block)
Decode a short string represented as a long[]

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

writeLatin1Characters

public static boolean writeLatin1Characters(String string,
                                            Bits bits)

calculateNumberOfBlocksUsed

public static int calculateNumberOfBlocksUsed(long firstBlock)

calculateNumberOfBlocksUsed

public static int calculateNumberOfBlocksUsed(int encoding,
                                              int length)


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