org.jboss.messaging.util
Class SimpleString

java.lang.Object
  extended by org.jboss.messaging.util.SimpleString
All Implemented Interfaces:
java.io.Serializable, java.lang.CharSequence

public class SimpleString
extends java.lang.Object
implements java.lang.CharSequence, java.io.Serializable

A SimpleString A simple String class that can store all characters, and stores as simple byte[], this minimises expensive copying between String objects

Author:
Tim Fox
See Also:
Serialized Form

Constructor Summary
SimpleString(byte[] data)
           
SimpleString(java.lang.String string)
           
 
Method Summary
 char charAt(int pos)
           
 boolean equals(java.lang.Object other)
           
 byte[] getData()
           
 int hashCode()
           
 int length()
           
static int sizeofString(SimpleString str)
           
 boolean startsWith(SimpleString other)
           
 java.lang.CharSequence subSequence(int start, int end)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleString

public SimpleString(java.lang.String string)

SimpleString

public SimpleString(byte[] data)
Method Detail

length

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

charAt

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

subSequence

public java.lang.CharSequence subSequence(int start,
                                          int end)
Specified by:
subSequence in interface java.lang.CharSequence

getData

public byte[] getData()

startsWith

public boolean startsWith(SimpleString other)

toString

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

equals

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

hashCode

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

sizeofString

public static int sizeofString(SimpleString str)


Copyright © 2006 JBoss Inc. All Rights Reserved.