com.stevesoft.pat
Interface StringLike

All Known Implementing Classes:
RandomAccessFileWrap, CharArrayWrap, StringWrap


public interface StringLike

Package pat can search anything that implements this interface. Package pat assumes the following:

Note that searching String is probably faster than searching other objects, so searching String is still preferred if possible.


Method Summary
 char charAt(int i)
           
 int indexOf(char c)
           
 int length()
           
 BasicStringBufferLike newStringBufferLike()
          By default, the result is put in a String or char[] when a replace is done.
 java.lang.String substring(int i1, int i2)
           
 java.lang.String toString()
           
 java.lang.Object unwrap()
          Obtain the underlying object, be it a String, char[], RandomAccessFile, whatever.
 

Method Detail

charAt

public char charAt(int i)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

length

public int length()

substring

public java.lang.String substring(int i1,
                                  int i2)

unwrap

public java.lang.Object unwrap()
Obtain the underlying object, be it a String, char[], RandomAccessFile, whatever.

newStringBufferLike

public BasicStringBufferLike newStringBufferLike()

By default, the result is put in a String or char[] when a replace is done. If you wish to save the result in some other StringBufferLike then you can do this by implementing this method, or over-riding it's behavior from an existing class.

indexOf

public int indexOf(char c)