Class RedBlackSquare

java.lang.Object
  extended byRedBlackSquare
All Implemented Interfaces:
Picture

public class RedBlackSquare
extends java.lang.Object
implements Picture

RedBlackSquare - A picture containing a smaller red square embedded within a larger black square.

Author:
Ben Bederson, Bill Pugh Copyright (C) 2003 University of Maryland

Constructor Summary
RedBlackSquare()
           
 
Method Summary
 PictureColor getColor(int x, int y)
          This specifies the content of a picture by returning the color of the picture at each pixel (i.e., position).
 int getHeight()
           
 int getWidth()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RedBlackSquare

public RedBlackSquare()
Method Detail

getColor

public PictureColor getColor(int x,
                             int y)
Description copied from interface: Picture
This specifies the content of a picture by returning the color of the picture at each pixel (i.e., position).

Specified by:
getColor in interface Picture
Parameters:
x - The column within the picture
y - The row within the picture
Returns:
The color of the picture at the specified location

getWidth

public int getWidth()
Specified by:
getWidth in interface Picture

getHeight

public int getHeight()
Specified by:
getHeight in interface Picture