corina.files
Class Hohenheim

java.lang.Object
  |
  +--corina.files.Filetype
        |
        +--corina.files.Hohenheim

public class Hohenheim
extends Filetype

"Hohemheim" format. I do not know what program uses this format natively.

I have been given one .K file and one .M file, and been told to write a Hohemheim interface from that. I'm making huge assumptions about Hohemheim's program. The only guarantee I can make today is that this will correctly load ABI_HOH.K and ABI_HOH.M. I don't even know what all the metadata fields are, so I can't save Hohemheim files.

Found a partial spec in Frank Rinn's TSAP manual, page 39. He calls it "Hemmenhofen".

Apparently there are 2 Hohemheim file formats. .K files are data-only, and .M files are data-count-weiserjahre. Unfortunately, I'm not going to count on the filename extension being correct for figuring out what type it is, because apparently nobody ever cares enough to be consistent. And the headers are identical, for better or for worse. On one hand, I can use the same parser for that line, but on the other hand, I won't know until it's too late which parser to use for the data.

Possible bug: it stops when it hits a value of 0. On a sample that ends in a -9 year, I suppose it would not have any zero-padding, so I should watch readLine() as well.

Version:
$Id: Hohenheim.java,v 1.3 2002/12/10 21:26:06 bitpoet Exp $
Author:
Ken Harris

Fields inherited from class corina.files.Filetype
r, w
 
Constructor Summary
Hohenheim()
           
 
Method Summary
 Sample load()
          Load a sample in Hohenheim format.
 void save(Sample sample)
          Save a Sample to disk.
 String toString()
          Return the human-readable name of this file format.
 
Methods inherited from class corina.files.Filetype
leftPad, load, load, makeFiletype, save, save
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Hohenheim

public Hohenheim()
Method Detail

toString

public String toString()
Return the human-readable name of this file format.
Overrides:
toString in class Filetype
Returns:
the name of this file format

load

public Sample load()
            throws IOException
Load a sample in Hohenheim format.
Overrides:
load in class Filetype
Parameters:
filename - file to load from
Returns:
Sample loaded from the file
Throws:
FileNotFoundException - if the file cannot be found
WrongFiletypeException - if the file is obviously not this filetype
IOException - if something goes wrong
See Also:
Sample

save

public void save(Sample sample)
          throws IOException
Save a Sample to disk. I don't know how to save Hohenheim samples, yet, so this just throws an exception.
Overrides:
save in class Filetype
Parameters:
filename - the file to save to
s - the sample to save
Throws:
IOException - if an I/O exception occurs