javatools.datatypes
Class ByteString

java.lang.Object
  extended by javatools.datatypes.ByteString
All Implemented Interfaces:
java.lang.CharSequence

public class ByteString
extends java.lang.Object
implements java.lang.CharSequence

This class is part of the Java Tools (see http://mpii.de/yago-naga/javatools). It is licensed under the Creative Commons Attribution License (see http://creativecommons.org/licenses/by/3.0) by the YAGO-NAGA team (see http://mpii.de/yago-naga). This class represents strings with 1 byte per character. Thus, they use roughly half as much space as ordinary strings -- but they also cannot store all characters. ByteStrings are always unique. they can be compared with ==.

Author:
Fabian M. Suchanek

Field Summary
 byte[] data
          Holds the string
 boolean isInterned
          is interned
 
Method Summary
 char charAt(int arg0)
           
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 int length()
           
static void main(java.lang.String[] args)
           
static ByteString of(java.lang.CharSequence s)
          Constructor
 java.lang.CharSequence subSequence(int arg0, int arg1)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

data

public byte[] data
Holds the string


isInterned

public boolean isInterned
is interned

Method Detail

of

public static ByteString of(java.lang.CharSequence s)
Constructor


charAt

public char charAt(int arg0)
Specified by:
charAt in interface java.lang.CharSequence

length

public int length()
Specified by:
length in interface java.lang.CharSequence

subSequence

public java.lang.CharSequence subSequence(int arg0,
                                          int arg1)
Specified by:
subSequence in interface java.lang.CharSequence

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Specified by:
toString in interface java.lang.CharSequence
Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception