|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectVennDrawing.VennDiagram
class VennDiagram
An object representing the Venn Diagram.
The main obejct which draws the venn diagram in a GUI.Copyright: Copyright (c) 2008
Company: Bangladesh University of engineering and technology
Field Summary | |
---|---|
static int |
ABSENT
MACRO defining any label is absent as value -1 |
(package private) int[][] |
Grid
The grid where values to be set |
(package private) int |
Gs
Grid Size |
(package private) int[] |
label
label Array |
(package private) java.util.PriorityQueue |
labelQueue
A priority queue where we can get the max label from it. |
(package private) int |
maxX
Maximum X in the grid of the GUI. |
(package private) int |
maxY
Maximum Y in the grid of the GUI. |
(package private) int |
order
Order of the venn diagram. |
(package private) RSet[] |
setArray
Array of All available Set Objects |
Constructor Summary | |
---|---|
VennDiagram(int order,
RSet[] setArray)
Constructor of the object. |
Method Summary | |
---|---|
private void |
construct()
The method which executes the algorithm for constructing the venn diagram. |
int |
countBits(int x)
Returns how many 1's in the number Like in '3' it contains 2 "1"s in the binary value. |
SetLabel |
getMax()
Removes the SetLabel which is marked as Max in the priority queue labelQueue |
private boolean |
isValid(int row,
int col,
int label)
Checks any grid position in Grid array, whether it is valid or not. |
static int |
power2(int x)
Implements the function f(x)=2^x. |
void |
printGrid()
Prints the grid values in the console in System.out.println(); |
(package private) void |
printQueue()
Prints the labelQueue |
private void |
removeLabel(int labelValue)
Removes a labels from the labelQueue linked list. |
void |
showGrid()
Prints the grid values in the javax.swing.JOptionPane.showMessageDialog(); |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ABSENT
int[] label
int Gs
int[][] Grid
java.util.PriorityQueue labelQueue
A priority queue where we can get the max label from it.
The queue keeps a list of SetLabel Objects. And dequeues a SetLabel object having the highest number of 1's in its binary representation.
int order
int maxX
int maxY
RSet[] setArray
Constructor Detail |
---|
public VennDiagram(int order, RSet[] setArray)
order
- order of the venn diagram . Should be less than 15.setArray
- Array of possible all sets as RSet objectsMethod Detail |
---|
void printQueue()
private void removeLabel(int labelValue)
lableValue
- the label which will be removed from the label queue.public static int power2(int x)
x
- the input
private void construct()
private boolean isValid(int row, int col, int label)
row
- row position of the grid in the Grid array.col
- column position of the grid in the Grid array.label
- label value for which the grid position to be checked.
public void showGrid()
public void printGrid()
public int countBits(int x)
x
- the value which's number of 1s in binary representation to be checked.
public SetLabel getMax()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |