| java.lang.Object xtc.typical.Primitives
Primitives | public class Primitives (Code) | | The primitives for Typical.
author: Robert Grimm version: $Revision: 1.48 $ |
Inner Class :final public static class Head implements Function.F1<T, Pair<T>> | |
Inner Class :final public static class Trace implements Function.F1<T, T> | |
Field Summary | |
final public static Function.F1<Float, Float> | absFloat32 Affirm a float. | final public static Function.F1<Double, Double> | absFloat64 Affirm a double. | final public static Function.F1<BigInteger, BigInteger> | absInt Affirm a big integer. | final public static Function.F2<Float, Float, Float> | addFloat32 Add two floats. | final public static Function.F2<Double, Double, Double> | addFloat64 Add two doubles. | final public static Function.F2<BigInteger, BigInteger, BigInteger> | addInt Add two big integers. | final public static Function.F2<Boolean, Boolean, Boolean> | and And two booleans. | final public static Function.F2<BigInteger, BigInteger, BigInteger> | andBits Bitwise and two big integers. | final public static Function.F3<Object, Node, String, Object> | annotate The typical function for annotating nodes. | final public static Function.F3<Object, Pair<Node>, String, Object> | annotateList The typical function for annotating lists of nodes. | final public static Function.F2<Pair, Pair, Pair> | append Non-destructively append two lists. | final public static Function.F2<String, String, String> | concat Concatenate two strings. | final public static Function.F2<Pair, Object, Pair> | cons Cons a value onto a list. | final public static Function.F2<Boolean, Object, Pair<?>> | contains Determine whether a list contains an element. | final public static Function.F2<Float, Float, Float> | divideFloat32 Divide two Floats. | final public static Function.F2<Double, Double, Double> | divideFloat64 Divide two doubles. | final public static Function.F2<BigInteger, BigInteger, BigInteger> | divideInt Divide two big integers. | final public static Function.F2<Boolean, String, String> | endsWith Check if the first string ends with the second. | final public static Function.F2<Boolean, String, String> | endsWithi | final public static Function.F2<Boolean, Object, Object> | equal Determine whether two objects are equal. | final public static Function.F2<Boolean, Function.F1<Boolean, Object>, Pair> | exists Determine whether a list element satisfies a predicate. | final public static Function.F3<Object, Function.F2<Object, Object, Object>, Pair, Object> | foldl Fold a list. | final public static Function.F1<BigInteger, Double> | ftoi Convert a float to an int . | final public static Function.F1<String, Double> | ftos Convert a float to a string. | final public static Function.F2<Object, Object, Hashtable<Object, Object>> | get A get function to access the hash table. | final public static Function.F2<Object, Node, String> | getAnnotation | final public static Function.F2<Boolean, Float, Float> | greaterEqualFloat32 Determine whether one float is greater than another. | final public static Function.F2<Boolean, Double, Double> | greaterEqualFloat64 Determine whether one double is greater than another. | final public static Function.F2<Boolean, BigInteger, BigInteger> | greaterEqualInt Determine whether one big integer is greater equal than another. | final public static Function.F2<Boolean, Float, Float> | greaterFloat32 Determine whether one float is greater than another. | final public static Function.F2<Boolean, Double, Double> | greaterFloat64 Determine whether one double is greater than another. | final public static Function.F2<Boolean, BigInteger, BigInteger> | greaterInt Determine whether one big integer is greater than another. | final public static Function.F2<Boolean, Node, String> | hasAnnotation | final public static Function.F1<Object, Pair<?>> | head Get a list's head. | final public static Function.F2<Pair, Pair, Pair> | intersection Determine the set intersection of two lists. | final public static Function.F1<Boolean, Object> | isBottom Test a value for bottom. | final public static Function.F1<Boolean, Pair<?>> | isEmpty Determine whether a list is empty. | final public static Function.F1<Boolean, Object> | isNotBottom Test a value for not being bottom. | final public static Function.F2<Object, Function.F1<Object, Object>, Pair> | iter Iterate a function over a list. | final public static Function.F1<Double, BigInteger> | itof Convert an int to a float. | final public static Function.F1<String, BigInteger> | itos Convert an interger to a string. | final public static Function.F1<String, Pair<String>> | joinStrings | final public static Function.F1<BigInteger, Pair<?>> | length Get a list's length. | final public static Function.F2<Boolean, Float, Float> | lessEqualFloat32 Determine whether one float is greater than another. | final public static Function.F2<Boolean, Double, Double> | lessEqualFloat64 Determine whether one double is greater than another. | final public static Function.F2<Boolean, BigInteger, BigInteger> | lessEqualInt Determine whether one big integer is less equal than another. | final public static Function.F2<Boolean, Float, Float> | lessFloat32 Determine whether one float is less than another. | final public static Function.F2<Boolean, Double, Double> | lessFloat64 Determine whether one double is less than another. | final public static Function.F2<Boolean, BigInteger, BigInteger> | lessInt Determine whether one big integer is less than another. | final public static Function.F2<Pair, Function.F1<Object, Object>, Pair> | map Map a function over a list. | final public static Function.F2<Float, Float, Float> | modFloat32 Determine the modulo of two floats. | final public static Function.F2<Double, Double, Double> | modFloat64 Determine the modulo of two doubles. | final public static Function.F2<BigInteger, BigInteger, BigInteger> | modInt Determine the modulo of two big integers. | final public static Function.F2<Float, Float, Float> | multiplyFloat32 Multiply two floats. | final public static Function.F2<Double, Double, Double> | multiplyFloat64 Multiply two doubles. | final public static Function.F2<BigInteger, BigInteger, BigInteger> | multiplyInt Multiply two big integers. | final public static Function.F1<BigInteger, BigInteger> | negateBits Bitwise negate a big integer. | final public static Function.F1<Float, Float> | negateFloat32 Negate a float. | final public static Function.F1<Double, Double> | negateFloat64 Negate a double. | final public static Function.F1<BigInteger, BigInteger> | negateInt Negate a big integer. | final public static Function.F1<String, Object> | node_name The function to get the name of a node. | final public static Function.F0<BigInteger> | nonce Create a nonce. | protected static BigInteger | nonceCounter The nonce counter. | final public static Function.F1<Boolean, Boolean> | not Negate a boolean. | final public static Function.F2<Object, Pair<?>, BigInteger> | nth Get a list's nth element. | final public static Function.F2<Boolean, Boolean, Boolean> | or Or two booleans. | final public static Function.F2<BigInteger, BigInteger, BigInteger> | orBits Bitwise or two big integers. | final public static Function.F3<Void, Object, Object, Hashtable<Object, Object>> | put A put function to access the hash table. | final public static Function.F2<BigInteger, BigInteger, BigInteger> | shiftLeft Shift left a big integer. | final public static Function.F2<BigInteger, BigInteger, BigInteger> | shiftRight Shift right a big integer. | final public static Function.F1<BigInteger, String> | ssize | final public static Function.F2<Boolean, String, String> | startsWith Check if the first string starts with the second. | final public static Function.F2<Boolean, String, String> | startsWithi Check if the first string starts with the second. | final public static Function.F1<Double, String> | stof Convert a string to a double. | final public static Function.F2<BigInteger, String, BigInteger> | stoi Convert a string to a big integer. | final public static Function.F2<String, String, BigInteger> | substring | final public static Function.F3<String, String, BigInteger, BigInteger> | substring2 | final public static Function.F2<Float, Float, Float> | subtractFloat32 Subtract two floats. | final public static Function.F2<Double, Double, Double> | subtractFloat64 Subtract two doubles. | final public static Function.F2<BigInteger, BigInteger, BigInteger> | subtractInt Subtract two big integers. | final public static Function.F2<Pair, Pair, Pair> | subtraction Determine the set subtraction of two lists. | final public static Function.F1<Pair<?>, Pair<?>> | tail Get a list's tail. | final public static Function.F1<Object, Object> | trace Trace a value. | final public static Function.F2<Object, String, Object> | trace2 Trace a value. | final public static Function.F2<Pair, Pair, Pair> | union Determine the set union of two lists. | final public static Function.F2<BigInteger, BigInteger, BigInteger> | xorBits Bitwise xor two big integers. |
Method Summary | |
public static String | convertName(String name) Convert a name from ML style to Java style.
Parameters: name - The name to convert. | final public static Pair<T> | copyPair(Pair<R> left) Copy a list.
Parameters: left - The list to copy. | final public static T | findInPair(Object o, Pair<T> p) Find an object in a pair.
Parameters: o - The object to find. Parameters: p - The list. | final public static Pair<T> | getChildren(Node n, int from, int to) Get children of a node by indice.
Parameters: n - The node to get children. Parameters: from - The start index. Parameters: to - The end index. | public static boolean | hasIntegerType(String name) | public static boolean | isPrimitive(String name) | final public static Pair<T> | removeFromPair(Object o, Pair<T> left) Remove an object from a list.
Parameters: o - The object to remove. Parameters: left - The list to remove an object from. | final public static int | toInt(BigInteger val) Convert the specified big integer to an int value.
Parameters: val - The big integer. | final public static void | trace(String msg, Object o) Trace the specified object. | final public static Pair<T> | wrapAppend(Pair<T> l, Pair<T> r) Magic cast wrapper for append
Parameters: l - The left pair. Parameters: r - The right pair. | final public static Pair<T> | wrapCons(T head, Pair<T> p) Magic cast wrapper for Primitives.cons
Parameters: head - The head of the pair. Parameters: p - The tail of the pair. | final public static T | wrapHead(Pair<T> p) Magic cast wrapper for head
Parameters: p - The pair. | final public static Pair<T> | wrapTail(Pair<T> p) Magic cast wrapper for Primitives.tail
Parameters: p - The pair. | final public static Pair<T> | wrapUnion(Pair<T> l, Pair<T> r) Magic cast wrapper for Primitives.union
Parameters: l - The left pair. Parameters: r - The right pair. |
convertName | public static String convertName(String name)(Code) | | Convert a name from ML style to Java style.
Parameters: name - The name to convert. The converted name. |
copyPair | final public static Pair<T> copyPair(Pair<R> left)(Code) | | Copy a list.
Parameters: left - The list to copy. The copy. |
findInPair | final public static T findInPair(Object o, Pair<T> p)(Code) | | Find an object in a pair.
Parameters: o - The object to find. Parameters: p - The list. The object or null if the list does notcontain the object. |
getChildren | final public static Pair<T> getChildren(Node n, int from, int to)(Code) | | Get children of a node by indice.
Parameters: n - The node to get children. Parameters: from - The start index. Parameters: to - The end index. null if the indice are out of range, otherwise return a pair of nodes. |
hasIntegerType | public static boolean hasIntegerType(String name)(Code) | | Check if a machine dependent constant has integer type
Parameters: name - The name of the constant true if that constant has integer type, otherwise false |
isPrimitive | public static boolean isPrimitive(String name)(Code) | | Check if a function is a primitive function
Parameters: name - The function name true or false |
removeFromPair | final public static Pair<T> removeFromPair(Object o, Pair<T> left)(Code) | | Remove an object from a list.
Parameters: o - The object to remove. Parameters: left - The list to remove an object from. The resulted list. |
toInt | final public static int toInt(BigInteger val)(Code) | | Convert the specified big integer to an int value.
Parameters: val - The big integer. The corresponding int value. throws: IllegalArgumentException - Signals that the big integer'svalue is too large. |
trace | final public static void trace(String msg, Object o)(Code) | | Trace the specified object.
Parameters: msg - The message prefix. Parameters: o - The object. |
wrapAppend | final public static Pair<T> wrapAppend(Pair<T> l, Pair<T> r)(Code) | | Magic cast wrapper for append
Parameters: l - The left pair. Parameters: r - The right pair. The concatenation of the two pairs. |
wrapCons | final public static Pair<T> wrapCons(T head, Pair<T> p)(Code) | | Magic cast wrapper for Primitives.cons
Parameters: head - The head of the pair. Parameters: p - The tail of the pair. The consed pair. |
wrapHead | final public static T wrapHead(Pair<T> p)(Code) | | Magic cast wrapper for head
Parameters: p - The pair. The head of the pair. |
wrapTail | final public static Pair<T> wrapTail(Pair<T> p)(Code) | | Magic cast wrapper for Primitives.tail
Parameters: p - The pair. The tail of the pair. |
wrapUnion | final public static Pair<T> wrapUnion(Pair<T> l, Pair<T> r)(Code) | | Magic cast wrapper for Primitives.union
Parameters: l - The left pair. Parameters: r - The right pair. The union of the two pairs. |
|
|