prob_1e
Class StringPlot

java.lang.Object
  extended by prob_1e.StringPlot

public class StringPlot
extends java.lang.Object

A class for generating a character-based plot.


Constructor Summary
StringPlot(java.lang.String title, int x_max, int y_max)
          The plot constructor, using an integer value plotting area
 
Method Summary
 void Print()
          Print out the plot.
 void put(char p_char, int x_pos, int y_pos)
          Put a single point into the plotting area.
 java.lang.String toString()
          Convert the plot area to a string for printing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringPlot

public StringPlot(java.lang.String title,
                  int x_max,
                  int y_max)
The plot constructor, using an integer value plotting area
     x in [0, x_max] and
     y in [0, y_max]
  

Parameters:
title - a title string for the plot.
x_max - the maximum x index.
y_max - the maximum y index.
Method Detail

put

public void put(char p_char,
                int x_pos,
                int y_pos)
Put a single point into the plotting area.

Parameters:
p_char - the plot character to place.
x_pos - the x position index.
y_pos - the y position index.

toString

public java.lang.String toString()
Convert the plot area to a string for printing.

Overrides:
toString in class java.lang.Object
Returns:
the output string containing the complete plot.

Print

public void Print()
Print out the plot.