Class logic.Util
All Packages Class Hierarchy This Package Previous Next Index
Class logic.Util
Object
|
+----logic.Util
- public class Util
- extends Object
Some utilities
-
TRUTH_TABLES
-
-
logic.Util()
-
-
booleansToString(Vector)
-
-
charVal(boolean)
- Returns 'T' if boolean argument is true, 'F' otherwise
-
equals(String, String)
- Arguments to this method are Strings composed of the characters
'T', 'F' or '*'.
-
findIndex(int, int[])
- Returns -1 if val is not one of the elements of intArr; otherwise
returns the index of val in intArr.
-
getInstance(String)
-
-
isBetween(int, int, int)
- Returns true if x < y < z, false otherwise
-
isBetweenOrEqualOnRight(int, int, int)
-
-
logBase2AsInt(double)
- this method returns largest int not greater than log_2(num),
for num >= 1, 0 otherwise
-
toBooleanArray(Vector)
- Returns an array of Booleans having length the parameter passed in;
if any element of Vector parameter
is not a Boolean, null is inserted into the array.
-
truthTable(int)
- This method creates truth tables for i propositional symbols,
where i ranges from 1 through numSymbols, and serves as the
first index in a 3-d array.
TRUTH_TABLES
public static int[][][] TRUTH_TABLES
Util
public Util()
booleansToString
public static java.lang.String booleansToString(Vector results)
charVal
public static char charVal(boolean b)
- Returns 'T' if boolean argument is true, 'F' otherwise
equals
public static boolean equals(String boolStrA,
String boolStrB)
- Arguments to this method are Strings composed of the characters
'T', 'F' or '*'. Two such Strings of equal length will be considered unequal
just in case for some i, the ith character of one String is a 'T'
and the ith character of the other String is an 'F'
findIndex
public static int findIndex(int val,
int intArr)
- Returns -1 if val is not one of the elements of intArr; otherwise
returns the index of val in intArr.
getInstance
public static java.lang.Object getInstance(String fullName)
isBetween
public static boolean isBetween(int x,
int y,
int z)
- Returns true if x < y < z, false otherwise
isBetweenOrEqualOnRight
public static boolean isBetweenOrEqualOnRight(int x,
int y,
int z)
logBase2AsInt
public static int logBase2AsInt(double num)
- this method returns largest int not greater than log_2(num),
for num >= 1, 0 otherwise
toBooleanArray
public static java.lang.Boolean[] toBooleanArray(Vector v)
- Returns an array of Booleans having length the parameter passed in;
if any element of Vector parameter
is not a Boolean, null is inserted into the array.
- Parameters:
- v - java.util.Vector
- Returns:
- java.lang.Boolean[]
truthTable
public static synchronized void truthTable(int numSymbols)
- This method creates truth tables for i propositional symbols,
where i ranges from 1 through numSymbols, and serves as the
first index in a 3-d array. The middle index refers to the column
of the ith table, and the last index refers to the row.
Truth values as stored as 0's (false) and 1's (true).
The 3-d array is stored in the static variable truthTables.
All Packages Class Hierarchy This Package Previous Next Index