iso8211 0-1-0 by Weft

uk.co.weft.iso8211
Class DDRField

java.lang.Object
  |
  +--uk.co.weft.iso8211.Field
        |
        +--uk.co.weft.iso8211.DDRField

public class DDRField
extends Field

A field in an ISO8211 record. As I understand it each field in the DDR describes the format of a record type in the rest of the file.

Version:
$Revision: 1.5 $ This revision: $Author: simon $
  $Log: DDRField.java,v $
  Revision 1.5  2002/11/02 00:09:16  simon
  Promising, but still not there. Problems include not correctly finding
  the start of the next record.

  Revision 1.4  2002/11/01 14:46:09  simon
  Much better! Now parsing most fields reasonably well.

  Revision 1.3  2002/10/31 23:04:28  simon
  Not in all truth a lot of progress. I'm parsing the DDR OK but when I come
  to real records I'm still not parsing them, and the reason seems to be that
  I'm not associating the right formats with the right field types. I'm still
  finding this very opaque.

  Revision 1.2  2002/10/31 19:25:22  simon


  This package of work is to take a parser which correctly recognised
  all the record and field boundaries, and try to make it read actual
  data. The DDR is now reading correctly (I believe) but the data are
  not being read, primarily because (I think) I'm not correctly making
  use of the data I read from the DDR.

  Revision 1.1.1.1  2002/10/29 11:27:33  simon
  More or less parses


  
Author:
Simon Brooke (simon@jasmine.org.uk)

Field Summary
protected  java.lang.String description
          my description
protected  java.util.Vector readers
          my subfields
 
Fields inherited from class uk.co.weft.iso8211.Field
index, record, subfields, tag
 
Constructor Summary
DDRField(ISO8211InputStream in, Record record, int index, boolean debug)
          /** create and return a Field object by reading from the current point in this stream
 
Method Summary
protected  int interpretFormat(java.lang.String format, java.util.StringTokenizer labelcutter, boolean debug)
          interpret the format string in a DDR subfield.
 
Methods inherited from class uk.co.weft.iso8211.Field
generate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

readers

protected java.util.Vector readers
my subfields

description

protected java.lang.String description
my description
Constructor Detail

DDRField

public DDRField(ISO8211InputStream in,
                Record record,
                int index,
                boolean debug)
         throws java.lang.Exception
/** create and return a Field object by reading from the current point in this stream
Parameters:
in - the stream to read me from
record - the record of which I form part
index - my index number within the record
ddr - the data description record for this file (?) needed?
debug - whether or not I'm in debug mode
Method Detail

interpretFormat

protected int interpretFormat(java.lang.String format,
                              java.util.StringTokenizer labelcutter,
                              boolean debug)
                       throws java.lang.Exception
interpret the format string in a DDR subfield. See ISO8211 paragraph 6.4.3.3. TODO: Should create and cache somthing that can read the subfield value described.
Parameters:
format - the format specifier string
desc - a buffer in which to create an expanded, english language string to check we understood what we got
labelcutter - a tokenizer on the subfield labels, to allow us to relate labels to formats
Returns:
(at this stage) an int - the number of identical items. meaningless!

iso8211 0-1-0 by Weft