com.stevesoft.pat.wrap
Class StringWrap
java.lang.Object
|
+--com.stevesoft.pat.wrap.StringWrap
- All Implemented Interfaces:
- StringLike
- public class StringWrap
- extends java.lang.Object
- implements StringLike
A basic wrapper for the String object. Regex does
not search String directly any longer, it searches StringLike.
|
Constructor Summary |
StringWrap(java.lang.String s)
|
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
StringWrap
public StringWrap(java.lang.String s)
toString
public java.lang.String toString()
- Specified by:
- toString in interface StringLike
- Overrides:
- toString in class java.lang.Object
charAt
public char charAt(int i)
- Specified by:
- charAt in interface StringLike
length
public int length()
- Specified by:
- length in interface StringLike
substring
public java.lang.String substring(int i1,
int i2)
- Specified by:
- substring in interface StringLike
unwrap
public java.lang.Object unwrap()
- Description copied from interface: StringLike
- Obtain the underlying object, be it a String, char[],
RandomAccessFile, whatever.
- Specified by:
- unwrap in interface StringLike
newStringBufferLike
public BasicStringBufferLike newStringBufferLike()
- Description copied from interface: StringLike
- 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.
- Specified by:
- newStringBufferLike in interface StringLike
indexOf
public int indexOf(char c)
- Specified by:
- indexOf in interface StringLike