com.stevesoft.pat.wrap
Class CharArrayWrap
java.lang.Object
|
+--com.stevesoft.pat.wrap.CharArrayWrap
- All Implemented Interfaces:
- StringLike
- public class CharArrayWrap
- extends java.lang.Object
- implements StringLike
This provides a wrapper for a char array so that
it can be searched by Regex.
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
CharArrayWrap
public CharArrayWrap(char[] ca)
getCharArray
public char[] getCharArray()
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