ukacgla_KMap
Class Abstract_Minterm

java.lang.Object
  |
  +--ukacgla_KMap.Abstract_Minterm

public abstract class Abstract_Minterm
extends java.lang.Object


Field Summary
protected  java.util.Vector cellVector
          Holds all cell Objects.
protected  java.lang.String correct
          Records if Minterm is correct or not.
protected  int[][] dataMap
          2D integer array used to map Cells.
protected  int dataMapCols
          Number of columns in dataMap.
protected  int dataMapRows
          Number of rows in dataMap.
protected  java.lang.StringBuffer minterm
          Holds the String description of the location of all Cell objects added.
 
Constructor Summary
Abstract_Minterm(java.lang.String b, int rows, int cols)
          Used to combine Cell objects into a single simplified Minterm.
 
Method Summary
 void add(Abstract_Cell c)
          Adds Cell to Vector.
 java.lang.String getCorrect()
          Returns String recording if Minterm is correct or false.
 java.lang.String getMinterm()
          Returns Minterm as a string.
abstract  void simplify()
          Concrete child classes will read dataMap[][] for specific sequences.
 void trim()
          Used to trim minterms of any excess '+'s created during building.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cellVector

protected java.util.Vector cellVector
Holds all cell Objects.

correct

protected java.lang.String correct
Records if Minterm is correct or not. Must be set as "correct" or "incorrect". A String is used for this information as a String is used to set the ActionCommand for each JCheckBox that will be linked to the Minterm.

dataMap

protected int[][] dataMap
2D integer array used to map Cells.

dataMapCols

protected int dataMapCols
Number of columns in dataMap.

dataMapRows

protected int dataMapRows
Number of rows in dataMap.

minterm

protected java.lang.StringBuffer minterm
Holds the String description of the location of all Cell objects added. The String description describes the 2D location of each cell added to the minterm, using row and column headers.
Constructor Detail

Abstract_Minterm

public Abstract_Minterm(java.lang.String b,
                        int rows,
                        int cols)
Used to combine Cell objects into a single simplified Minterm. Creates a new Vector to hold all cells. Creates a new StringBuffer to hold the strings of each cell. Records of this minTerm is correct or not. Builds a 2D Integer Array with all cells set to 0. This array will later be used in the simplify() method.
Method Detail

add

public void add(Abstract_Cell c)
Adds Cell to Vector. Add String of Cell object to Minterm StringBuffer. Adds a + to separate Cell strings. Sets the dataMap to 1 to indicate a cell occupies this space in the map.

getCorrect

public java.lang.String getCorrect()
Returns String recording if Minterm is correct or false.

getMinterm

public java.lang.String getMinterm()
Returns Minterm as a string.

simplify

public abstract void simplify()
Concrete child classes will read dataMap[][] for specific sequences. If specified sequence is met, append chars to answer, and reset data in table Finally, make this instance of minterm a copy of answer.

trim

public void trim()
Used to trim minterms of any excess '+'s created during building.