fj.function.Characters Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of functionaljava Show documentation
Show all versions of functionaljava Show documentation
Functional Java is an open source library that supports closures for the Java programming language
package fj.function;
import fj.F;
import fj.F2;
import static fj.Function.curry;
/**
* First-class functions on Characters.
*/
public final class Characters {
private Characters() {
throw new UnsupportedOperationException();
}
public static final F toString = new F() {
public String f(final Character c) {return Character.toString(c);}
};
public static final F isLowerCase = new F() {
public Boolean f(final Character ch) {return Character.isLowerCase(ch);}
};
public static final F isUpperCase = new F() {
public Boolean f(final Character ch) {return Character.isUpperCase(ch);}
};
public static final F isTitleCase = new F() {
public Boolean f(final Character ch) {return Character.isTitleCase(ch);}
};
public static final F isDigit = new F() {
public Boolean f(final Character ch) {return Character.isDigit(ch);}
};
public static final F isDefined = new F() {
public Boolean f(final Character ch) {return Character.isDefined(ch);}
};
public static final F isLetter = new F() {
public Boolean f(final Character ch) {return Character.isLetter(ch);}
};
public static final F isLetterOrDigit = new F() {
public Boolean f(final Character ch) {return Character.isLetterOrDigit(ch);}
};
public static final F isJavaIdentifierStart = new F() {
public Boolean f(final Character ch) {return Character.isJavaIdentifierStart(ch);}
};
public static final F isJavaIdentifierPart = new F() {
public Boolean f(final Character ch) {return Character.isJavaIdentifierPart(ch);}
};
public static final F isUnicodeIdentifierStart = new F() {
public Boolean f(final Character ch) {return Character.isUnicodeIdentifierStart(ch);}
};
public static final F isUnicodeIdentifierPart = new F() {
public Boolean f(final Character ch) {return Character.isUnicodeIdentifierPart(ch);}
};
public static final F isIdentifierIgnorable = new F() {
public Boolean f(final Character ch) {return Character.isIdentifierIgnorable(ch);}
};
public static final F toLowerCase = new F() {
public Character f(final Character ch) {return Character.toLowerCase(ch);}
};
public static final F toUpperCase = new F() {
public Character f(final Character ch) {return Character.toUpperCase(ch);}
};
public static final F toTitleCase = new F() {
public Character f(final Character ch) {return Character.toTitleCase(ch);}
};
public static final F> digit = curry(new F2() {
public Integer f(final Character ch, final Integer radix) {return Character.digit(ch, radix);}
});
public static final F getNumericValue = new F() {
public Integer f(final Character ch) {return Character.getNumericValue(ch);}
};
public static final F isSpaceChar = new F() {
public Boolean f(final Character ch) {return Character.isSpaceChar(ch);}
};
public static final F isWhitespace = new F() {
public Boolean f(final Character ch) {return Character.isWhitespace(ch);}
};
public static final F isISOControl = new F() {
public Boolean f(final Character ch) {return Character.isISOControl(ch);}
};
public static final F getType = new F() {
public Integer f(final Character ch) {return Character.getType(ch);}
};
public static final F getDirectionality = new F() {
public Byte f(final Character ch) {return Character.getDirectionality(ch);}
};
public static final F isMirrored = new F() {
public Boolean f(final Character ch) {return Character.isMirrored(ch);}
};
public static final F reverseBytes = new F() {
public Character f(final Character ch) {return Character.reverseBytes(ch);}
};
public static final F isNewLine = new F() {
public Boolean f(final Character c) { return c == '\n'; }
};
}