List of usage examples for com.google.common.base CharMatcher or
public CharMatcher or(CharMatcher other)
From source file:apps.Source2XML.java
/** * //from www . j a v a 2s. c o m * A good word should start from the letter: it may contain a letter, * a dash, or an apostrophe. * * @param text input * * @return true if a good word. */ protected static boolean isGoodWord(String text) { if (text.isEmpty()) return false; // CharMatcher m = (CharMatcher.JAVA_LETTER_OR_DIGIT).and(CharMatcher.ASCII); m = m.or(CharMatcher.is('-')); m = m.or(CharMatcher.is('\'')); return m.matchesAllOf(text); }
From source file:org.jboss.as.console.client.core.Header.java
private String logoName(String productName) { CharMatcher digits = CharMatcher.inRange('0', '9'); CharMatcher alpha = CharMatcher.inRange('a', 'z'); return digits.or(alpha).retainFrom(productName.toLowerCase()); }