backend
Class SphereFileReader

java.lang.Object
  extended by backend.SphereFileReader

public class SphereFileReader
extends java.lang.Object

SphereFileReader should be used to read in a sphere file of a given filename the file format is in SphereFileWriter if you desire to see it.


Constructor Summary
SphereFileReader(java.lang.String filename, java.awt.Component errorMsgFrame)
          SphereFileReader default constructor
 
Method Summary
 SphereCircleModel getCircle(int index)
          getCircle will return the given circle requested by the user
 int getCircleCount()
          getCircleCount will return the number of circles that have bene read in from file
 SphereIntrModel getIntr(int index)
          getIntr returns the SphereLineIntrModel for the given index number which is between 0 and getIntrCount()
 int getIntrCount()
          getIntrCount will return the amount of intersections that there are
 SphereLineModel getLine(int index)
          getLine returns a line corresponding to the zero based index
 int getLineCount()
          getLineCount returns the number of lines read in
 InformationNugget getNugget(int index)
          getString returns a String cooresponding to the zero based index
 int getNuggetCount()
          getStringCount returns the number of Strings we have read in
 int getParaTransCount()
          getParaTransCount will return the number of SphereParaTransModels there were read in from the file
 SphereParaTransModel getParaTransModel(int index)
          getParaTransModel will return the given SphereParaTransModel
 SpherePointModel getPoint(int index)
          getPoint returns a point given a zero based index
 int getPointCount()
          getPointCount returns the number of points read in
 SphereModel getSphereModel()
          return the sphere model that we read in
 boolean isDataValid()
          isDataValid should be called before doing anything with this file reader.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SphereFileReader

public SphereFileReader(java.lang.String filename,
                        java.awt.Component errorMsgFrame)
SphereFileReader default constructor

Parameters:
filename - The name of the data file to read
errorMsgFrame - The frame to display error messages in
Method Detail

isDataValid

public boolean isDataValid()
isDataValid should be called before doing anything with this file reader. If this is not called you have no way of knowing if the data was valid or not

Returns:
True if the data is safe to use, false if something went wrong

getPointCount

public int getPointCount()
getPointCount returns the number of points read in

Returns:
the number of points that were read in

getPoint

public SpherePointModel getPoint(int index)
getPoint returns a point given a zero based index

Parameters:
index - of the point to return
Returns:
The point for the 0 based index given. Null is returned if the data read in had an error

getLineCount

public int getLineCount()
getLineCount returns the number of lines read in

Returns:
The number of lines read in

getLine

public SphereLineModel getLine(int index)
getLine returns a line corresponding to the zero based index

Parameters:
index - of the line to return
Returns:
The line of the zero based index, or null if the data was invalid

getNuggetCount

public int getNuggetCount()
getStringCount returns the number of Strings we have read in

Returns:
the number of nuggets we have read in

getNugget

public InformationNugget getNugget(int index)
getString returns a String cooresponding to the zero based index

Parameters:
index - of the String to return
Returns:
The String at the given zero based index or null if there was a problem reading the data

getSphereModel

public SphereModel getSphereModel()
return the sphere model that we read in

Returns:
The sphere model formed when the file was read in

getIntrCount

public int getIntrCount()
getIntrCount will return the amount of intersections that there are

Returns:
the number of SphereLineIntrModels

getIntr

public SphereIntrModel getIntr(int index)
getIntr returns the SphereLineIntrModel for the given index number which is between 0 and getIntrCount()

Parameters:
index - the SphereLineIntrModel to return
Returns:
the SphereLineIntrModel

getParaTransModel

public SphereParaTransModel getParaTransModel(int index)
getParaTransModel will return the given SphereParaTransModel

Parameters:
index - is the index of the SphereParaTransModel to retreive
Returns:
the requested SphereParaTransModel

getParaTransCount

public int getParaTransCount()
getParaTransCount will return the number of SphereParaTransModels there were read in from the file

Returns:
the number of SphereParaTransModels that were read in

getCircleCount

public int getCircleCount()
getCircleCount will return the number of circles that have bene read in from file

Returns:
number of circles read in

getCircle

public SphereCircleModel getCircle(int index)
getCircle will return the given circle requested by the user

Parameters:
index - is the index of the circle to return
Returns:
the circle at the given index