|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--A1Driver
A user interface to drive the Space and Point classes. This implementation does not include the full user interface as specified in the assignment handout. It includes the methods that were required to be implemented. A1Driver is used by A1Test to perform some tests on the program.
Constructor Summary | |
A1Driver()
|
Method Summary | |
void |
get(int i)
Print the point at position i in the collection ordered by the current view point. |
void |
initSpace()
Create and initialize the space object |
void |
load(java.lang.String filename)
Load the points defined from the file filename into the collection |
static void |
main(java.lang.String[] args)
|
void |
printSpace()
Print the collection of points from the space in the order of a point's distance from the view point. |
void |
readPoint()
Prompt for and read a point from the keyboard, and add it to the space. |
void |
readViewPoint()
Prompt for and read a point from the keyboard. |
void |
samePlane(int k)
Print the list of points that are in the same kth plane as the view point. |
void |
write(java.lang.String filename)
Write the collection of points into a file in the same format as the input file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public A1Driver()
Method Detail |
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
public void load(java.lang.String filename) throws java.io.IOException
filename
- Name of the file containing the
list of points.
File format: One point per line in the order of the
dimensions (x, y, z).
Assumption: The file is correctly formatted.
java.io.IOException
public void write(java.lang.String filename) throws java.io.IOException
filename
- Name of file to be written. The file
will be overwritten if it already exists.
java.io.IOException
public void readPoint() throws java.io.IOException
java.io.IOException
public void readViewPoint() throws java.io.IOException
java.io.IOException
public void get(int i)
i
- The position of the point to retrieve.public void printSpace()
public void samePlane(int k)
k
- Index of the plane to report onpublic void initSpace()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |