@Override public boolean matches(char c) { return Character.isDigit(c); }
public boolean acceptChar (TextField textField, char c) { return Character.isDigit(c); } }
public boolean acceptChar (TextField textField, char c) { return Character.isDigit(c); } }
@Override public boolean matches(char c) { return Character.isDigit(c); }
public static boolean isNumeric(String str) { if (str == null) { return false; } int sz = str.length(); for (int i = 0; i < sz; i++) { if (!Character.isDigit(str.charAt(i))) { return false; } } return true; }
public static boolean isNumeric(String str) { if (str == null) { return false; } int sz = str.length(); for (int i = 0; i < sz; i++) { if (!Character.isDigit(str.charAt(i))) { return false; } } return true; }
public static boolean isNumeric(String str) { for (char c : str.toCharArray()) { if (!Character.isDigit(c)) return false; } return true; }
private static String getDigital(String v) { int index = 0; for (int i = 0; i < v.length(); i++) { char c = v.charAt(i); if (Character.isDigit(c)) { if (i == v.length() - 1) { index = i + 1; } else { index = i; } } else { index = i; break; } } return v.substring(0, index); }
private static String getDigital(String v) { int index = 0; for (int i = 0; i < v.length(); i++) { char c = v.charAt(i); if (Character.isDigit(c)) { if (i == v.length() - 1) { index = i + 1; } else { index = i; } } else { index = i; break; } } return v.substring(0, index); }
@Override public Instant parse(String text, Locale locale) throws ParseException { if (text.length() > 0 && Character.isDigit(text.charAt(0))) { // assuming UTC instant a la "2007-12-03T10:15:30.00Z" return Instant.parse(text); } else { // assuming RFC-1123 value a la "Tue, 3 Jun 2008 11:05:30 GMT" return Instant.from(DateTimeFormatter.RFC_1123_DATE_TIME.parse(text)); } }
protected static boolean containsNumber(String s) { if (s == null) { return false; } for (int i = 0, len = s.length(); i < len; i++) { if (Character.isDigit(s.charAt(i))) { return true; } } return false; }
private static boolean isDigits(String in) { for (int i = 0, len = in.length(); i < len; i++) { if ( ! Character.isDigit(in.charAt(i))) { return false; } } return true; }
/** * Determine whether the given method is a CGLIB 'renamed' method, * following the pattern "CGLIB$methodName$0". * @param renamedMethod the method to check * @see org.springframework.cglib.proxy.Enhancer#rename */ public static boolean isCglibRenamedMethod(Method renamedMethod) { String name = renamedMethod.getName(); if (name.startsWith(CGLIB_RENAMED_METHOD_PREFIX)) { int i = name.length() - 1; while (i >= 0 && Character.isDigit(name.charAt(i))) { i--; } return ((i > CGLIB_RENAMED_METHOD_PREFIX.length()) && (i < name.length() - 1) && name.charAt(i) == '$'); } return false; }
private static boolean withDecimalsParsing(final String str, final int beginIdx) { int decimalPoints = 0; for (int i = beginIdx; i < str.length(); i++) { final boolean isDecimalPoint = str.charAt(i) == '.'; if (isDecimalPoint) { decimalPoints++; } if (decimalPoints > 1) { return false; } if (!isDecimalPoint && !Character.isDigit(str.charAt(i))) { return false; } } return true; }
static int fieldPropertyNumber( String fieldName ) { int index = 0; for ( int i = 0; i < fieldName.length() && Character.isDigit( fieldName.charAt( i ) ); i++ ) { index++; } return index == 0 ? 0 : Integer.parseInt( fieldName.substring( 0, index ) ); }
protected static boolean containsAlphanumeric(String s) { if (s == null) { return false; } for (int i = 0, len = s.length(); i < len; i++) { if (Character.isLetter(s.charAt(i)) || Character.isDigit(s.charAt(i))) { return true; } } return false; }
@Override public Instant parse(String text, Locale locale) throws ParseException { if (text.length() > 0 && Character.isDigit(text.charAt(0))) { // assuming UTC instant a la "2007-12-03T10:15:30.00Z" return Instant.parse(text); } else { // assuming RFC-1123 value a la "Tue, 3 Jun 2008 11:05:30 GMT" return Instant.from(DateTimeFormatter.RFC_1123_DATE_TIME.parse(text)); } }
public static Symbol cannonicalSymbol(char ch) { if (Character.isDigit(ch)) { return DIGIT; //{ Digits.add(new Character(ch)); return DIGIT; } } if (Character.getNumericValue(ch) >= 10 && Character.getNumericValue(ch) <= 35) { return LETTER; //{ Letters.add(new Character(ch)); return LETTER; } } return new Symbol(ch); }
protected String readNums() { skipWS(); int pos = in.position(); int ch = in.readChar(); while (Character.isDigit(ch) || ch == '.' || ch == 'E' || ch == 'e' || ch == '+' || ch == '-' || ch == '_') { ch = in.readChar(); } in.back(1); return in.getString(pos, in.position() - pos).replace("_",""); }
private void checkClassName(ClassNode cls) { ClassInfo classInfo = cls.getClassInfo(); ClassInfo alias = classInfo.getAlias(); String clsName = alias.getShortName(); String newShortName = null; char firstChar = clsName.charAt(0); if (Character.isDigit(firstChar)) { newShortName = Consts.ANONYMOUS_CLASS_PREFIX + clsName; } else if (firstChar == '$') { newShortName = "C" + clsName; } if (newShortName != null) { classInfo.rename(cls.root(), alias.makeFullClsName(newShortName, true)); } if (alias.getPackage().isEmpty()) { String fullName = alias.makeFullClsName(alias.getShortName(), true); String newFullName = Consts.DEFAULT_PACKAGE_NAME + "." + fullName; classInfo.rename(cls.root(), newFullName); } }