client.mandelbrot
Class MandelbrotGUITask

java.lang.Object
  extended by client.mandelbrot.MandelbrotGUITask

public class MandelbrotGUITask
extends java.lang.Object

Wrapper class for the Mandelbrot set inputs given in the MandelbrotGUI.

Author:
Mark Wiley

Constructor Summary
MandelbrotGUITask()
          Creates a new instance of MandelbrotTask
MandelbrotGUITask(double iStart, double rStart, double sideLength, int iterMax, int resolution, double rScale, double gScale, double bScale)
          Creates a new instance of MandelbrotGUITask
MandelbrotGUITask(MandelbrotGUITask task)
          Copy Constructor
 
Method Summary
static void addIntermediateTasks(java.util.ArrayList<MandelbrotGUITask> tasks, MandelbrotGUITask t1, MandelbrotGUITask t2, int numFrames)
          Static method calculates MandelbrotGUITasks that lie between the two given tasks
 MbrotTask convert()
           
 boolean equals(MandelbrotGUITask task)
          Determines if two tasks are computationally equivilent
 double getBScale()
           
 double getGScale()
           
 double getImaginaryStart()
           
 int getIterMax()
           
 double getRealStart()
           
 int getResolution()
           
 double getRScale()
           
 double getSideLength()
           
 boolean isZoomRelativeOf(MandelbrotGUITask task)
          Determines if this task is a zoom relative of another
 void setBScale(double b)
           
 void setGScale(double g)
           
 void setImaginaryStart(double i)
           
 void setIterMax(int i)
           
 void setRealStart(double r)
           
 void setResolution(int r)
           
 void setRScale(double r)
           
 void setSideLength(double s)
           
 MbrotEvent solve()
          Solve the task with a Mandelbrot solver without decomposing
 void splitAndSolve(java.util.concurrent.LinkedBlockingQueue<MbrotEvent> eventQueue, int pieces)
          Decomposes this task and creates MandelbrotSolver threads to solve each sub-Task
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MandelbrotGUITask

public MandelbrotGUITask()
Creates a new instance of MandelbrotTask


MandelbrotGUITask

public MandelbrotGUITask(double iStart,
                         double rStart,
                         double sideLength,
                         int iterMax,
                         int resolution,
                         double rScale,
                         double gScale,
                         double bScale)
Creates a new instance of MandelbrotGUITask

Parameters:
iStart - Imaginary component starting point.
rStart - Real component starting point.
sideLength - Side Length in complex plane.
iterMax - Iteration limit for computation.
resolution - Resolution of the resulting solution.
rScale - Red scale value
gScale - Green scale value
bScale - Blue scale value

MandelbrotGUITask

public MandelbrotGUITask(MandelbrotGUITask task)
Copy Constructor

Parameters:
task - The MandelbrotGUITask to copy
Method Detail

convert

public MbrotTask convert()

getImaginaryStart

public double getImaginaryStart()

getRealStart

public double getRealStart()

getSideLength

public double getSideLength()

getIterMax

public int getIterMax()

getResolution

public int getResolution()

getRScale

public double getRScale()

getGScale

public double getGScale()

getBScale

public double getBScale()

setImaginaryStart

public void setImaginaryStart(double i)

setRealStart

public void setRealStart(double r)

setSideLength

public void setSideLength(double s)

setIterMax

public void setIterMax(int i)

setResolution

public void setResolution(int r)

setRScale

public void setRScale(double r)

setGScale

public void setGScale(double g)

setBScale

public void setBScale(double b)

equals

public boolean equals(MandelbrotGUITask task)
Determines if two tasks are computationally equivilent

Parameters:
task - The MandelbrotGUITask to compare this to.
Returns:
True if the this and the passed task are computationally equivilent.

isZoomRelativeOf

public boolean isZoomRelativeOf(MandelbrotGUITask task)
Determines if this task is a zoom relative of another

Parameters:
task - The potential zoom relative task
Returns:
True if this and the passed task are room relatives

splitAndSolve

public void splitAndSolve(java.util.concurrent.LinkedBlockingQueue<MbrotEvent> eventQueue,
                          int pieces)
Decomposes this task and creates MandelbrotSolver threads to solve each sub-Task

Parameters:
eventQueue - The queue to store sub-Results in
pieces - The number of pieces to decompose this task into. (should be a whole square 4, 9, 25...)

solve

public MbrotEvent solve()
Solve the task with a Mandelbrot solver without decomposing

Returns:
The solution to the task.

addIntermediateTasks

public static void addIntermediateTasks(java.util.ArrayList<MandelbrotGUITask> tasks,
                                        MandelbrotGUITask t1,
                                        MandelbrotGUITask t2,
                                        int numFrames)
Static method calculates MandelbrotGUITasks that lie between the two given tasks

Parameters:
tasks - The queue to add computed intermediate tasks to
t1 - The begining task
t2 - The ending task
numFrames - The number of intermediate tasks to find between t1 and t2.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object