public class FHX2_FileRequiredPart extends java.lang.Object implements java.io.Serializable, javax.swing.event.ChangeListener, ErrorTrackerInterface
Modifier and Type | Field and Description |
---|---|
private int |
dataSetFirstYear |
private int |
dataSetLastYear |
private int |
idLength |
private java.util.Vector<javax.swing.event.ChangeListener> |
listeners
The following methods are for the vector change listener.
|
private static int |
MINIMUM_ID_LENGTH |
private java.util.List<FHX2_Sample> |
sampleList |
private static long |
serialVersionUID |
Constructor and Description |
---|
FHX2_FileRequiredPart()
Default Constructor for FHX2_FileRequiredPart.
|
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(javax.swing.event.ChangeListener l) |
void |
addEventToSample(int index,
FHX2_Event inEvent)
Adds an event to a specific sample.
|
void |
addSample(FHX2_Sample inSample)
Adds a new sample to the data.
|
void |
addSample(java.lang.String inName,
int inSampleFirstYear,
int inSampleLastYear,
boolean inPith,
boolean inBark)
Adds a new sample to the data.
|
void |
calculateFirstYear()
Calculates the starting year or the dataset's first year for given sample.
|
void |
calculateIDLength()
Calculates the appropriate length for the unique sample identifier.
|
void |
calculateLastYear()
Calculates the ending year or the dataset's last year for a given sample.
|
void |
deleteSample(int index)
Deletes a sample from the data.
|
private void |
fireSampleEvent()
TODO
|
int |
getDataSetFirstYear()
Returns the year with the earliest instance of recorded data out of all sample in the current FHX2 file.
|
int |
getDataSetLastYear()
Returns the year with the latest instance of recorded data out of all samples in the current FHX2 file.
|
java.util.ArrayList<SampleErrorModel> |
getErrors()
Retrieves a complete list of the errors detected in the file during load.
|
FHX2_Event |
getEvent(int sampleIndex,
int eventIndex)
Gets an event of a specific sample.
|
int |
getIDLength()
Returns the length of the longest unique identifier for any sample in the current FHX2 file to leave number of lines for displaying
the sample name in the file.
|
int |
getNumSamples()
Returns the number of samples in the current FHX2 file.
|
FHX2_Sample |
getSample(int index)
Gets the sample at the specified index of the list.
|
java.util.List<FHX2_Sample> |
getSampleList()
Gets a list of all samples in the current FHX2 file with a type as the FHX2_Sample class.
|
void |
removeChangeListener(javax.swing.event.ChangeListener l) |
void |
setDataSetFirstYear(int inFirstYear)
Sets the first year of the data set to value of the input parameter.
|
void |
setDataSetLastYear(int inLastYear)
Sets the last year of the data set to value of the input parameter.
|
void |
setIDLength(int idLength)
Sets the length of the unique sample identifier.
|
void |
stateChanged(javax.swing.event.ChangeEvent e)
Handles when the state of an event is changed.
|
private static final long serialVersionUID
private static final int MINIMUM_ID_LENGTH
private java.util.List<FHX2_Sample> sampleList
private int idLength
private int dataSetFirstYear
private int dataSetLastYear
private java.util.Vector<javax.swing.event.ChangeListener> listeners
public FHX2_FileRequiredPart()
public int getIDLength()
public void setIDLength(int idLength)
idLength
- public int getDataSetFirstYear()
public void setDataSetFirstYear(int inFirstYear)
inFirstYear
- public int getDataSetLastYear()
public void setDataSetLastYear(int inLastYear)
inFirstYear
- public java.util.List<FHX2_Sample> getSampleList()
public void addSample(java.lang.String inName, int inSampleFirstYear, int inSampleLastYear, boolean inPith, boolean inBark)
inName
- (name of sample)inSampleFirstYear
- (first year of sample)inSampleLastYear
- (last year of sample)inPith
- (whether or not there is pith recorded at the first year)inBark
- (whether or not there is back recorded at the last year)public void addSample(FHX2_Sample inSample)
inSample
- public void deleteSample(int index)
index
- (the index of the sample to delete)public void addEventToSample(int index, FHX2_Event inEvent)
index
- inEvent
- public FHX2_Sample getSample(int index)
index
- public int getNumSamples()
public FHX2_Event getEvent(int sampleIndex, int eventIndex)
sampleIndex
- (the index of the sample to get)eventIndex
- (the index of the event of the sample to get)public void calculateIDLength()
public void calculateFirstYear()
public void calculateLastYear()
public void stateChanged(javax.swing.event.ChangeEvent e)
stateChanged
in interface javax.swing.event.ChangeListener
public java.util.ArrayList<SampleErrorModel> getErrors()
getErrors
in interface ErrorTrackerInterface
public void addChangeListener(javax.swing.event.ChangeListener l)
public void removeChangeListener(javax.swing.event.ChangeListener l)
private void fireSampleEvent()