Class algebra.table
public class table extends entity implements Drawable, Cloneable {}
This class holds a table of Words with the row and column
headings and the most interesting of all!!
Field Index:
- int rows
- int cols
- vector row_heading
- Since we do not know the number of rows at the beginning I declared
them to be vector
- which is a subclass of java.util.Vector with some added functionality.
It is in fact a vector
- of Words.
- vector col_heading
- Though we know the number of columns, it has been declared as a vector
for the sake of
- uniformity. This is also a vector of Words.
- vector values
- This contains the values inside the table. It is also a vector but
its elements are arrays of
- Words of length cols. That is, values holds rows ( each
is an array of Words of length cols. )
Constructor Index:
- table()
- table( int c )
- table( int r, int c )
Method Index:
- Object clone()
- int get_cols()
- int get_rows()
- Words get_value( int i, int j )
- This returns the element(Word(s) ) in the 'i'th row and 'j'th
column.
- void add_row_heading( vector val )
- This just creates a clone of the incoming vector 'val' and assigns
it to row_heading. The
- vector 'val' infact has Words ( shall we say an array
of Words! ) that are built in the
- application applet which are individual exercises.
- void add_col_heading( vector val )
- void add_row( Words[] val )
- This appends the incoming array of Words( which are in fact
individual rows ) to the vector
- values.
- void draw( Graphics g, integer W, integer H, integer X, integer
Y )
- Each column in this table is of fixed width. It is the maximum size()
of the Words in
- col_heading and values. Within each column the Words
are right justified.
algebra Package / misc
Package / Making of the project
/ Project Home Page / My
Home Page