Class HLine

java.lang.Object
  extended byHLine

public class HLine
extends Object

A horizontal line has a length and a paintChar used used to paint the line on a Screen.

Version:
3

Constructor Summary
HLine(int length, char paintChar)
          Construct an HLine.
 
Method Summary
 int getLength()
          Get the length of this line.
static void main(String[] args)
          Unit test for class HLine, assuming Screen and Terminal work.
 void paintOn(Screen s)
          Paint this HLine on Screen s at position (0,0).
 void paintOn(Screen s, int x, int y)
          Paint this HLine on Screen s at position (x,y).
 void setLength(int length)
          Set the length of this line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HLine

public HLine(int length,
             char paintChar)
Construct an HLine.

Parameters:
length - length in (character) pixels.
paintChar - character used for painting this Line.
Method Detail

getLength

public int getLength()
Get the length of this line.

Returns:
the length in (character) pixels.

main

public static void main(String[] args)
Unit test for class HLine, assuming Screen and Terminal work.


paintOn

public void paintOn(Screen s)
Paint this HLine on Screen s at position (0,0).

Parameters:
s - the Screen on which this line is to be painted.

paintOn

public void paintOn(Screen s,
                    int x,
                    int y)
Paint this HLine on Screen s at position (x,y).

Parameters:
s - the Screen on which this line is to be painted.
x - the x position for the line.
y - the y position for the line.

setLength

public void setLength(int length)
Set the length of this line.

Parameters:
length - the new length in (character) pixels.