|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--corina.Sample
Class representing a reading of a dendro sample.
Currently, this stores:
Field Summary | |
List |
count
Number of samples in the sum at any given point. |
List |
data
Data, as a List of Integers. |
List |
decr
|
List |
elements
Elements (in a List) that were put into this sum. |
List |
incr
|
static String[] |
LOADERS
Class loaders to try, as an array of strings (fully-qualified class names). |
Map |
meta
Sample metadata, as a (String, Object) Map. |
static int |
MR
The value of a missing ring, 2. |
Range |
range
Data range. |
static String[] |
SKIP_EXTENSIONS
Filename extensions of files to ignore out of principle: .XLS, .DOC, .JPG, .GIF, and .TIF are a good start. |
Constructor Summary | |
Sample()
Default constructor. |
|
Sample(String filename)
Create a new Sample from a given file on disk. |
|
Sample(URL url)
|
Method Summary | |
void |
addSampleListener(SampleListener l)
|
void |
clearModified()
Clear the modified flag. |
int |
computeRadius()
|
static void |
copy(Sample source,
Sample target)
|
int |
count3SampleIntervals()
|
int |
countRings()
Count the total number of rings. |
int |
countSignificantIntervals()
|
void |
fireSampleDataChanged()
|
void |
fireSampleElementsChanged()
|
void |
fireSampleFormatChanged()
|
void |
fireSampleMetadataChanged()
|
void |
fireSampleRedated()
|
List |
getData()
Return the data for a graph. |
Integer |
getInteger(String field)
|
List |
getList(String field)
|
Preview |
getPreview()
|
static Sample |
getSample(String filename)
|
float |
getScale()
Return the default scale factor for graphing. |
Year |
getStart()
Return the start date for a graph. |
String |
getString(String field)
|
UndoableEditSupport |
getUndoSupport()
|
void |
guessIndexed()
|
boolean |
hasWeiserjahre()
|
boolean |
isAbsolute()
Return true if the sample is absolutely dated, else false. |
boolean |
isEditable()
|
boolean |
isIndexed()
Return true if the sample is indexed, else false. |
boolean |
isModified()
Return true if the file was modified since last save. |
boolean |
isOak()
|
boolean |
isSummed()
Return true if the sample is summed, else false. |
void |
load(String filename)
|
static void |
main(String[] args)
Load a Sample from disk. |
void |
postEdit(UndoableEdit x)
|
void |
removeSampleListener(SampleListener l)
|
void |
save()
Save this Sample to disk to the same filename it had previously. |
void |
save(String filename)
Save this Sample to disk. |
void |
setModified()
Set the modified flag. |
String |
toString()
Return the sample's title. |
void |
verify()
|
boolean |
wasMetadataChanged()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int MR
public List data
public Range range
public Map meta
Internal name (key) | Data type | Valid values |
---|---|---|
id | Integer | |
title | String | |
dating | String | A, R |
unmeas_pre | Integer | |
unmeas_post | Integer | |
filename | String | |
comments | String | |
type | String | S, H, C |
species | String | |
sapwood | Integer | |
pith | String | +, *, N |
terminal | String | v, vv, B, W |
continuous | String | C, R, N |
quality | String | +, ++ |
format | String | R, I |
index_type | Integer | |
reconciled | String | Y,N |
author | String |
data
, count
, range
,
wj
, and elements
aren't stored in
meta
- they're their own members.Corina
public List count
public List incr
public List decr
public List elements
public static final String[] LOADERS
public static final String[] SKIP_EXTENSIONS
Constructor Detail |
public Sample()
data
and count
are initialized but empty
range
is initialized
meta
is initialized, and:
user.name
wj
is null
elements
is null
meta
public Sample(String filename) throws FileNotFoundException, WrongFiletypeException, IOException
filename
- the name of the file to loadFileNotFoundException
- if the file doesn't existWrongFiletypeException
- if the file is not a SampleIOException
- if there is an I/O error while loading
the filepublic Sample(URL url) throws IOException
Method Detail |
public String getString(String field)
public Integer getInteger(String field)
public List getList(String field)
public boolean hasWeiserjahre()
public static Sample getSample(String filename) throws IOException
public static void copy(Sample source, Sample target)
public boolean isIndexed()
public boolean isSummed()
Return true if the sample is summed, else false. Here "summed" is defined as:
public boolean isAbsolute()
public boolean isModified()
public void setModified()
public void clearModified()
public List getData()
getData
in interface Graphable
public Year getStart()
getStart
in interface Graphable
public float getScale()
getScale
in interface Graphable
public String toString()
toString
in class Object
public int countRings()
public int computeRadius()
public int count3SampleIntervals()
public int countSignificantIntervals()
public static void main(String[] args) throws Exception
filename
- the file to loadFileNotFoundException
- if the file could not be foundWrongFiletypeException
- if the file is not a SampleIOException
- if a low-level I/O error occurspublic void load(String filename) throws IOException
public void guessIndexed()
public void verify()
public void save(String filename) throws IOException
filename
- the name of the file to save toIOException
- if an I/O error occurspublic void save() throws IOException
IOException
- if an I/O error occurspublic Preview getPreview()
getPreview
in interface Previewable
public boolean isOak()
public boolean isEditable()
public void addSampleListener(SampleListener l)
public void removeSampleListener(SampleListener l)
public void fireSampleRedated()
public void fireSampleDataChanged()
public void fireSampleMetadataChanged()
public void fireSampleFormatChanged()
public void fireSampleElementsChanged()
public boolean wasMetadataChanged()
public void postEdit(UndoableEdit x)
public UndoableEditSupport getUndoSupport()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |