iso8211 0-1-0 by Weft

uk.co.weft.iso8211
Class Value

java.lang.Object
  |
  +--uk.co.weft.iso8211.Value
Direct Known Subclasses:
Binary, BitString, CharData, CharMode, ExplicitPoint, ImplicitPoint, MSOFBinary, ScaledPoint

public abstract class Value
extends java.lang.Object

Abstract superclass for a subfield value; real classes which implement values are in the package uk.co.weft.iso8211.values

Version:
$Revision: 1.3 $ This revision: $Author: simon $
  $Log: Value.java,v $
  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  boolean debug
          whether or not we're in debug mode
protected  int delimiter
          my delimiter if not fixed width else -1
protected  int precision
          how many bytes I occupy if fixed width else -1
protected  int subtype
          my subtype if relevent else -1
 
Constructor Summary
Value()
           
 
Method Summary
 void initialise(int precision, int delimiter, int subtype, boolean debug)
          You can't use a constructor for a value because we don't know what class it is when we create it so we have to use Class.newInstance(); consequently, to initialise it we need an initialiser.
 void read(ISO8211InputStream in)
          Specialise this! Dummy does nothing except skip the right number of places on the stream to check we're still in sync
 java.lang.String toString()
          yes, I know anything can be rendered as a string, but a value explicitly can.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

precision

protected int precision
how many bytes I occupy if fixed width else -1

delimiter

protected int delimiter
my delimiter if not fixed width else -1

subtype

protected int subtype
my subtype if relevent else -1

debug

protected boolean debug
whether or not we're in debug mode
Constructor Detail

Value

public Value()
Method Detail

initialise

public void initialise(int precision,
                       int delimiter,
                       int subtype,
                       boolean debug)
                throws FormatException
You can't use a constructor for a value because we don't know what class it is when we create it so we have to use Class.newInstance(); consequently, to initialise it we need an initialiser.
Parameters:
precision - how many bytes I occupy if fixed width else -1
delimiter - my delimiter if not fixed width else -1
subtype - my subtype if relevent else -1
debug - whether or not we're in debug mode

read

public void read(ISO8211InputStream in)
          throws java.io.IOException,
                 FormatException
Specialise this! Dummy does nothing except skip the right number of places on the stream to check we're still in sync

toString

public java.lang.String toString()
yes, I know anything can be rendered as a string, but a value explicitly can. You must over-ride this!
Overrides:
toString in class java.lang.Object

iso8211 0-1-0 by Weft