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


Variable Index

 o TRUTH_TABLES

Constructor Index

 o logic.Util()

Method Index

 o booleansToString(Vector)
 o charVal(boolean)
Returns 'T' if boolean argument is true, 'F' otherwise
 o equals(String, String)
Arguments to this method are Strings composed of the characters 'T', 'F' or '*'.
 o findIndex(int, int[])
Returns -1 if val is not one of the elements of intArr; otherwise returns the index of val in intArr.
 o getInstance(String)
 o isBetween(int, int, int)
Returns true if x < y < z, false otherwise
 o isBetweenOrEqualOnRight(int, int, int)
 o logBase2AsInt(double)
this method returns largest int not greater than log_2(num), for num >= 1, 0 otherwise
 o 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.
 o 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.

Variables

 o TRUTH_TABLES
public static int[][][] TRUTH_TABLES

Constructors

 o Util
public Util()

Methods

 o booleansToString
public static java.lang.String booleansToString(Vector results)
 o charVal
public static char charVal(boolean b)
Returns 'T' if boolean argument is true, 'F' otherwise

 o 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'

 o 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.

 o getInstance
public static java.lang.Object getInstance(String fullName)
 o isBetween
public static boolean isBetween(int x,
                                int y,
                                int z)
Returns true if x < y < z, false otherwise

 o isBetweenOrEqualOnRight
public static boolean isBetweenOrEqualOnRight(int x,
                                              int y,
                                              int z)
 o logBase2AsInt
public static int logBase2AsInt(double num)
this method returns largest int not greater than log_2(num), for num >= 1, 0 otherwise

 o 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[]
 o 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