X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fcom%2Fstevesoft%2Fpat%2FStringLike.java;h=fa01fe65764a4642641cff78fff503d3ef7eb553;hb=577b0bf651763fe609eb6d6343754662023b3eac;hp=07bc441e9fc286d3d962abeb2675921df18424a7;hpb=7bc226b58110fa26d9dbd3f0c78095d06909ffc3;p=jalview.git diff --git a/src/com/stevesoft/pat/StringLike.java b/src/com/stevesoft/pat/StringLike.java index 07bc441..fa01fe6 100755 --- a/src/com/stevesoft/pat/StringLike.java +++ b/src/com/stevesoft/pat/StringLike.java @@ -1,44 +1,47 @@ -package // -// This software is now distributed according to -// the Lesser Gnu Public License. Please see -// http://www.gnu.org/copyleft/lesser.txt for -// the details. -// -- Happy Computing! -// - com.stevesoft.pat; - -/** 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. - */ -public interface StringLike -{ - public char charAt(int i); - - public String toString(); - - public int length(); - - public String substring(int i1, int i2); - - /** Obtain the underlying object, be it a String, char[], - RandomAccessFile, whatever. */ - public Object unwrap(); - - /** 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. */ - public BasicStringBufferLike newStringBufferLike(); - - public int indexOf(char c); -} +package // +// This software is now distributed according to +// the Lesser Gnu Public License. Please see +// http://www.gnu.org/copyleft/lesser.txt for +// the details. +// -- Happy Computing! +// +com.stevesoft.pat; + +/** + * 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. + */ +public interface StringLike +{ + public char charAt(int i); + + public String toString(); + + public int length(); + + public String substring(int i1, int i2); + + /** + * Obtain the underlying object, be it a String, char[], RandomAccessFile, + * whatever. + */ + public Object unwrap(); + + /** + * 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. + */ + public BasicStringBufferLike newStringBufferLike(); + + public int indexOf(char c); +}