git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Jalview-JS/JAL-3253-applet Creating
[jalview.git]
/
src
/
com
/
stevesoft
/
pat
/
Regex.java
diff --git
a/src/com/stevesoft/pat/Regex.java
b/src/com/stevesoft/pat/Regex.java
index
c00ddad
..
7b5214c
100755
(executable)
--- a/
src/com/stevesoft/pat/Regex.java
+++ b/
src/com/stevesoft/pat/Regex.java
@@
-16,9
+16,11
@@
import java.util.Hashtable;
import com.stevesoft.pat.wrap.StringWrap;
import com.stevesoft.pat.wrap.StringWrap;
+
/** Matches a Unicode punctuation character. */
class UnicodePunct extends UniValidator
{
/** Matches a Unicode punctuation character. */
class UnicodePunct extends UniValidator
{
+ @Override
public int validate(StringLike s, int from, int to)
{
return from < s.length() && Prop.isPunct(s.charAt(from)) ? to : -1;
public int validate(StringLike s, int from, int to)
{
return from < s.length() && Prop.isPunct(s.charAt(from)) ? to : -1;
@@
-28,6
+30,7
@@
class UnicodePunct extends UniValidator
/** Matches a Unicode white space character. */
class UnicodeWhite extends UniValidator
{
/** Matches a Unicode white space character. */
class UnicodeWhite extends UniValidator
{
+ @Override
public int validate(StringLike s, int from, int to)
{
return from < s.length() && Prop.isWhite(s.charAt(from)) ? to : -1;
public int validate(StringLike s, int from, int to)
{
return from < s.length() && Prop.isWhite(s.charAt(from)) ? to : -1;
@@
-39,6
+42,7
@@
class UnicodeWhite extends UniValidator
*/
class NUnicodePunct extends UniValidator
{
*/
class NUnicodePunct extends UniValidator
{
+ @Override
public int validate(StringLike s, int from, int to)
{
return from < s.length() && !Prop.isPunct(s.charAt(from)) ? to : -1;
public int validate(StringLike s, int from, int to)
{
return from < s.length() && !Prop.isPunct(s.charAt(from)) ? to : -1;
@@
-50,6
+54,7
@@
class NUnicodePunct extends UniValidator
*/
class NUnicodeWhite extends UniValidator
{
*/
class NUnicodeWhite extends UniValidator
{
+ @Override
public int validate(StringLike s, int from, int to)
{
return from < s.length() && !Prop.isWhite(s.charAt(from)) ? to : -1;
public int validate(StringLike s, int from, int to)
{
return from < s.length() && !Prop.isWhite(s.charAt(from)) ? to : -1;
@@
-59,6
+64,7
@@
class NUnicodeWhite extends UniValidator
/** Matches a Unicode word character: an alphanumeric or underscore. */
class UnicodeW extends UniValidator
{
/** Matches a Unicode word character: an alphanumeric or underscore. */
class UnicodeW extends UniValidator
{
+ @Override
public int validate(StringLike s, int from, int to)
{
if (from >= s.length())
public int validate(StringLike s, int from, int to)
{
if (from >= s.length())
@@
-74,6
+80,7
@@
class UnicodeW extends UniValidator
/** Matches a character that is not a Unicode alphanumeric or underscore. */
class NUnicodeW extends UniValidator
{
/** Matches a character that is not a Unicode alphanumeric or underscore. */
class NUnicodeW extends UniValidator
{
+ @Override
public int validate(StringLike s, int from, int to)
{
if (from >= s.length())
public int validate(StringLike s, int from, int to)
{
if (from >= s.length())
@@
-89,6
+96,7
@@
class NUnicodeW extends UniValidator
/** Matches a Unicode decimal digit. */
class UnicodeDigit extends UniValidator
{
/** Matches a Unicode decimal digit. */
class UnicodeDigit extends UniValidator
{
+ @Override
public int validate(StringLike s, int from, int to)
{
return from < s.length() && Prop.isDecimalDigit(s.charAt(from)) ? to
public int validate(StringLike s, int from, int to)
{
return from < s.length() && Prop.isDecimalDigit(s.charAt(from)) ? to
@@
-99,6
+107,7
@@
class UnicodeDigit extends UniValidator
/** Matches a character that is not a Unicode digit. */
class NUnicodeDigit extends UniValidator
{
/** Matches a character that is not a Unicode digit. */
class NUnicodeDigit extends UniValidator
{
+ @Override
public int validate(StringLike s, int from, int to)
{
return from < s.length() && !Prop.isDecimalDigit(s.charAt(from)) ? to
public int validate(StringLike s, int from, int to)
{
return from < s.length() && !Prop.isDecimalDigit(s.charAt(from)) ? to
@@
-109,6
+118,7
@@
class NUnicodeDigit extends UniValidator
/** Matches a Unicode math character. */
class UnicodeMath extends UniValidator
{
/** Matches a Unicode math character. */
class UnicodeMath extends UniValidator
{
+ @Override
public int validate(StringLike s, int from, int to)
{
return from < s.length() && Prop.isMath(s.charAt(from)) ? to : -1;
public int validate(StringLike s, int from, int to)
{
return from < s.length() && Prop.isMath(s.charAt(from)) ? to : -1;
@@
-118,6
+128,7
@@
class UnicodeMath extends UniValidator
/** Matches a non-math Unicode character. */
class NUnicodeMath extends UniValidator
{
/** Matches a non-math Unicode character. */
class NUnicodeMath extends UniValidator
{
+ @Override
public int validate(StringLike s, int from, int to)
{
return from < s.length() && !Prop.isMath(s.charAt(from)) ? to : -1;
public int validate(StringLike s, int from, int to)
{
return from < s.length() && !Prop.isMath(s.charAt(from)) ? to : -1;
@@
-127,6
+138,7
@@
class NUnicodeMath extends UniValidator
/** Matches a Unicode currency symbol. */
class UnicodeCurrency extends UniValidator
{
/** Matches a Unicode currency symbol. */
class UnicodeCurrency extends UniValidator
{
+ @Override
public int validate(StringLike s, int from, int to)
{
return from < s.length() && Prop.isCurrency(s.charAt(from)) ? to : -1;
public int validate(StringLike s, int from, int to)
{
return from < s.length() && Prop.isCurrency(s.charAt(from)) ? to : -1;
@@
-136,6
+148,7
@@
class UnicodeCurrency extends UniValidator
/** Matches a non-currency symbol Unicode character. */
class NUnicodeCurrency extends UniValidator
{
/** Matches a non-currency symbol Unicode character. */
class NUnicodeCurrency extends UniValidator
{
+ @Override
public int validate(StringLike s, int from, int to)
{
return from < s.length() && !Prop.isCurrency(s.charAt(from)) ? to : -1;
public int validate(StringLike s, int from, int to)
{
return from < s.length() && !Prop.isCurrency(s.charAt(from)) ? to : -1;
@@
-145,6
+158,7
@@
class NUnicodeCurrency extends UniValidator
/** Matches a Unicode alphabetic character. */
class UnicodeAlpha extends UniValidator
{
/** Matches a Unicode alphabetic character. */
class UnicodeAlpha extends UniValidator
{
+ @Override
public int validate(StringLike s, int from, int to)
{
return from < s.length() && Prop.isAlphabetic(s.charAt(from)) ? to : -1;
public int validate(StringLike s, int from, int to)
{
return from < s.length() && Prop.isAlphabetic(s.charAt(from)) ? to : -1;
@@
-154,6
+168,7
@@
class UnicodeAlpha extends UniValidator
/** Matches a non-alphabetic Unicode character. */
class NUnicodeAlpha extends UniValidator
{
/** Matches a non-alphabetic Unicode character. */
class NUnicodeAlpha extends UniValidator
{
+ @Override
public int validate(StringLike s, int from, int to)
{
return from < s.length() && !Prop.isAlphabetic(s.charAt(from)) ? to
public int validate(StringLike s, int from, int to)
{
return from < s.length() && !Prop.isAlphabetic(s.charAt(from)) ? to
@@
-164,6
+179,7
@@
class NUnicodeAlpha extends UniValidator
/** Matches an upper case Unicode character. */
class UnicodeUpper extends UniValidator
{
/** Matches an upper case Unicode character. */
class UnicodeUpper extends UniValidator
{
+ @Override
public int validate(StringLike s, int from, int to)
{
return from < s.length() && isUpper(s.charAt(from)) ? to : -1;
public int validate(StringLike s, int from, int to)
{
return from < s.length() && isUpper(s.charAt(from)) ? to : -1;
@@
-178,6
+194,7
@@
class UnicodeUpper extends UniValidator
/** Matches an upper case Unicode character. */
class UnicodeLower extends UniValidator
{
/** Matches an upper case Unicode character. */
class UnicodeLower extends UniValidator
{
+ @Override
public int validate(StringLike s, int from, int to)
{
return from < s.length() && isLower(s.charAt(from)) ? to : -1;
public int validate(StringLike s, int from, int to)
{
return from < s.length() && isLower(s.charAt(from)) ? to : -1;
@@
-290,6
+307,16
@@
class UnicodeLower extends UniValidator
*/
public class Regex extends RegRes implements FilenameFilter
{
*/
public class Regex extends RegRes implements FilenameFilter
{
+
+ static
+ {
+ /**
+ * @j2sNative
+ *
+ * swingjs.JSUtil.loadStaticResource$S("core/core_stevesoft.z.js");
+ */
+ }
+
/**
* BackRefOffset gives the identity number of the first pattern. Version 1.0
* used zero, version 1.1 uses 1 to be more compatible with perl.
/**
* BackRefOffset gives the identity number of the first pattern. Version 1.0
* used zero, version 1.1 uses 1 to be more compatible with perl.
@@
-599,7
+626,7
@@
public class Regex extends RegRes implements FilenameFilter
/** Essentially clones the Regex object */
public Regex(Regex r)
{
/** Essentially clones the Regex object */
public Regex(Regex r)
{
- super((RegRes) r);
+ super(r);
dontMatchInQuotes = r.dontMatchInQuotes;
esc = r.esc;
ignoreCase = r.ignoreCase;
dontMatchInQuotes = r.dontMatchInQuotes;
esc = r.esc;
ignoreCase = r.ignoreCase;
@@
-674,6
+701,7
@@
public class Regex extends RegRes implements FilenameFilter
* patterns are equal as well as the most recent match. If a Regex is compare
* with a RegRes, only the result of the most recent match is compared.
*/
* patterns are equal as well as the most recent match. If a Regex is compare
* with a RegRes, only the result of the most recent match is compared.
*/
+ @Override
public boolean equals(Object o)
{
if (o instanceof Regex)
public boolean equals(Object o)
{
if (o instanceof Regex)
@@
-694,6
+722,7
@@
public class Regex extends RegRes implements FilenameFilter
}
/** A clone by any other name would smell as sweet. */
}
/** A clone by any other name would smell as sweet. */
+ @Override
public Object clone()
{
return new Regex(this);
public Object clone()
{
return new Regex(this);
@@
-1077,7
+1106,7
@@
public class Regex extends RegRes implements FilenameFilter
{
try
{
{
try
{
- return (Regex) getClass().newInstance();
+ return getClass().newInstance();
} catch (InstantiationException ie)
{
return null;
} catch (InstantiationException ie)
{
return null;
@@
-1641,7
+1670,7
@@
public class Regex extends RegRes implements FilenameFilter
{
if (p instanceof Any && p.next == null)
{
{
if (p instanceof Any && p.next == null)
{
- return (Pattern) new DotMulti(lo, hi);
+ return new DotMulti(lo, hi);
}
return RegOpt.safe4fm(p) ? (Pattern) new FastMulti(lo, hi, p)
: (Pattern) new Multi(lo, hi, p);
}
return RegOpt.safe4fm(p) ? (Pattern) new FastMulti(lo, hi, p)
: (Pattern) new Multi(lo, hi, p);
@@
-1801,6
+1830,7
@@
public class Regex extends RegRes implements FilenameFilter
* representations. Also be prepared to see some strange output if your
* characters are not printable.
*/
* representations. Also be prepared to see some strange output if your
* characters are not printable.
*/
+ @Override
public String toString()
{
if (false && thePattern == null)
public String toString()
{
if (false && thePattern == null)
@@
-1901,6
+1931,7
@@
public class Regex extends RegRes implements FilenameFilter
*
* @see com.stevesoft.pat.FileRegex
*/
*
* @see com.stevesoft.pat.FileRegex
*/
+ @Override
public boolean accept(File dir, String s)
{
return search(s);
public boolean accept(File dir, String s)
{
return search(s);