harpoon.Analysis.GraphColoring
Class ColorFactory

java.lang.Object
  extended by harpoon.Analysis.GraphColoring.ColorFactory

public abstract class ColorFactory
extends Object

ColorFactory

Version:
$Id: ColorFactory.java,v 1.2 2002/02/25 20:57:15 cananian Exp $
Author:
Felix S. Klock II <pnkfelix@mit.edu>

Constructor Summary
ColorFactory()
          Creates a ColorFactory.
 
Method Summary
 Vector getColors()
          Inventory accessor.
 Color makeColor()
          Color generator.
protected abstract  Color newColor()
          Color generator that subclasses must implement.
 void removeColor()
          Factory downsizer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorFactory

public ColorFactory()
Creates a ColorFactory.

Method Detail

makeColor

public Color makeColor()
Color generator.
modifies: this
effects: If no Colors have been removed from this, constructs a new Color and returns it. Else returns the most recently removed Color and flags the Color returned as no longer being removed from this.


removeColor

public void removeColor()
Factory downsizer.
modifies: this
effects: If Colors exist in this for distribution, removes the last produced Color from the internal colors list. Else does nothing.


newColor

protected abstract Color newColor()
Color generator that subclasses must implement.
effects: Constructs a new Color and returns it.


getColors

public Vector getColors()
Inventory accessor.
effects: Returns a Vector of all of the Colors currently distributable from this.
requires: makeColor and removeColor are not called as long as the Vector returned is in use.