# Class Sorter.GraphicOrder

public class GraphicOrder
extends Sorter.AOrder

A decorated ordering strategy that temporarily changes the color of the compared objects. The objects are assumed to be of type IColoredObject

##

aOrder
  The decorated ordering strategy--the "decoree"
compareColor
  The color to temporarily switch the compared objects to
waitTime
  The number of milliseconds to pause while the objects are set to the compare color

##

GraphicOrder (Color, int, AOrder)
  The constructor for this class

##

blink (IColoredObject, IColoredObject)
  Changes the color of xIGC and yIGC to the compareColor, sleeps for waitTime milliseconds and then changes the colors back to their original state
eq (Object, Object)
  Calls blink(x,y) and then delegates to the decoree
ge (Object, Object)
  Calls blink(x,y) and then delegates to the decoree
gt (Object, Object)
  Calls blink(x,y) and then delegates to the decoree
le (Object, Object)
  Calls blink(x,y) and then delegates to the decoree
lt (Object, Object)
  Calls blink(x,y) and then delegates to the decoree
ne (Object, Object)
  Calls blink(x,y) and then delegates to the decoree
setCompareColor (Color)
  An accessor method for compareColor
setOrder (AOrder)
  An accessor method for the decoree
setWaitTime (int)
  An accessor method for the waitTime

##

compareColor

    private Color compareColor = Color.red

  The color to temporarily switch the compared objects to.

waitTime

    private int waitTime = 200

  The number of milliseconds to pause while the objects are set to the compare color.

aOrder

    private AOrder aOrder

  The decorated ordering strategy--the "decoree".

##

GraphicOrder

    public  GraphicOrder(Color compareColor, int waitTime, AOrder aOrder)

  The constructor for this class.

  Parameters:
    compareColor - The color to change the objects to.
    waitTime - The amount of time to pause (sleep) after changing the color.
    aOrder - The decoree.

##

eq

    public boolean eq(Object x, Object y)

  Calls blink(x,y) and then delegates to the decoree.

  Parameters:
    x -
    y -
  Returns:

ne

    public boolean ne(Object x, Object y)

  Calls blink(x,y) and then delegates to the decoree.

  Returns:

lt

    public boolean lt(Object x, Object y)

  Calls blink(x,y) and then delegates to the decoree.

  Returns:

le

    public boolean le(Object x, Object y)

  Calls blink(x,y) and then delegates to the decoree.

  Returns:

gt

    public boolean gt(Object x, Object y)

  Calls blink(x,y) and then delegates to the decoree.

  Returns:

ge

    public boolean ge(Object x, Object y)

  Calls blink(x,y) and then delegates to the decoree.

  Returns:

blink

    protected void blink(IColoredObject xIGC, IColoredObject yIGC)

  Changes the color of xIGC and yIGC to the compareColor, sleeps for waitTime milliseconds and then changes the colors back to their original state.

  Parameters:
    xIGC -
    yIGC -

setCompareColor

    public void setCompareColor(Color compareColor)

  An accessor method for compareColor.

  Parameters:
    compareColor -

setWaitTime

    public void setWaitTime(int waitTime)

  An accessor method for the waitTime

  Parameters:
    waitTime -

setOrder

    public void setOrder(AOrder aOrder)

  An accessor method for the decoree.

  Parameters:
    aOrder -