wt.series
Class FileBasedSeries

java.lang.Object
  extended bywt.series.Series
      extended bywt.series.FileBasedSeries
All Implemented Interfaces:
Cloneable, Externalizable, NetFactor, ObjectMappable, Serializable

public class FileBasedSeries
extends Series
implements Externalizable

Defines a sequencing model based on an XML input file stored in the SeriesTemplate table.

Use the newFileBasedSeries static factory method(s), not the FileBasedSeries constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: true

Extendable: false

See Also:
Serialized Form

Nested Class Summary
(package private) static class FileBasedSeries.Singleton
           
 
Field Summary
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
private  String maturity
           
static String MATURITY
          Label for the attribute.
static String NO_SEED
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private  String series
           
static String SERIES
          Label for the attribute.
private static List values
           
 
Fields inherited from class wt.series.Series
VALUE
 
Constructor Summary
FileBasedSeries()
           
 
Method Summary
private  int compare(FileBasedSeries series)
          This method was created because we can't trust the maturity level on the series -- 1 can be associated to MILSTD and A to NUMERIC.
 void decrement()
          Specifies an abstract means of decrementing the value to the next adjacent descending value in a series.
 boolean equals(Series object)
          Tests if this series is equal to the given one and returns true.
 String getConceptualClassname()
          Deprecated.  
 String getMaturity()
          Gets the value of the attribute: MATURITY.
private  int getMaturityIndex(String a_maturity)
           
 String getSeries()
          Gets the value of the attribute: SERIES.
private  int getSeriesIndex(String a_series)
           
private  String getSeriesKey()
           
 int getValueIndex()
           
private  List getValues(String a_series, String a_maturity)
           
 boolean greaterThan(Series object)
          Tests if this series is greater than to the given one and returns true.
 void increment()
          Specifies an abstract means of incrementing the value to the next adjacent ascending value in a series.
protected  void initialize(String series, String maturity)
          Supports initialization, following construction of an instance.
private  boolean isPromote()
           
 boolean lessThan(Series object)
          Tests if this series is less than to the given one and returns true.
static FileBasedSeries newFileBasedSeries(String series, String maturity)
          Makes a new instance where the value at the given series and maturity level is set to the given string.
private  String nextValue()
           
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
 void readExternal(PersistentRetrieveIfc input)
          Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(FileBasedSeries thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void reset()
          Specifies an abstract means of resetting the value to the first one in a series.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 void writeExternal(PersistentStoreIfc output)
          Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store.
 
Methods inherited from class wt.series.Series
clone, getClassInfo, getValue, newSeries, newSeries, readVersion, setValue, setValueWithoutValidating, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

SERIES

public static final String SERIES
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

series

private String series

MATURITY

public static final String MATURITY
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

maturity

private String maturity

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

values

private static List values

NO_SEED

public static final String NO_SEED
See Also:
Constant Field Values
Constructor Detail

FileBasedSeries

public FileBasedSeries()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class Series
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class Series
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(FileBasedSeries thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(PersistentStoreIfc output)
                   throws SQLException,
                          DatastoreException
Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store.

(Not intended for general use.)

Supported API: false

Specified by:
writeExternal in interface ObjectMappable
Overrides:
writeExternal in class Series
Parameters:
output -
Throws:
SQLException
DatastoreException

readExternal

public void readExternal(PersistentRetrieveIfc input)
                  throws SQLException,
                         DatastoreException
Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store.

(Not intended for general use.)

Supported API: false

Specified by:
readExternal in interface ObjectMappable
Overrides:
readExternal in class Series
Parameters:
input -
Throws:
SQLException
DatastoreException

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Returns:
String

getSeries

public String getSeries()
Gets the value of the attribute: SERIES.

Supported API: false

Returns:
String

getMaturity

public String getMaturity()
Gets the value of the attribute: MATURITY.

Supported API: false

Returns:
String

newFileBasedSeries

public static FileBasedSeries newFileBasedSeries(String series,
                                                 String maturity)
                                          throws SeriesException,
                                                 WTPropertyVetoException
Makes a new instance where the value at the given series and maturity level is set to the given string.

Supported API: true

Parameters:
series -
maturity -
Returns:
FileBasedSeries
Throws:
SeriesException
WTPropertyVetoException

initialize

protected void initialize(String series,
                          String maturity)
                   throws SeriesException,
                          WTPropertyVetoException
Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.

Supported API: true

Parameters:
series -
maturity -
Throws:
SeriesException
WTPropertyVetoException

reset

public void reset()
           throws SeriesException,
                  WTPropertyVetoException
Specifies an abstract means of resetting the value to the first one in a series.

Supported API: true

Specified by:
reset in class Series
Throws:
SeriesException
WTPropertyVetoException

increment

public void increment()
               throws SeriesException,
                      WTPropertyVetoException
Specifies an abstract means of incrementing the value to the next adjacent ascending value in a series.

Supported API: true

Specified by:
increment in class Series
Throws:
SeriesException
WTPropertyVetoException

decrement

public void decrement()
               throws SeriesException,
                      WTPropertyVetoException
Specifies an abstract means of decrementing the value to the next adjacent descending value in a series.

Supported API: true

Specified by:
decrement in class Series
Throws:
SeriesException
WTPropertyVetoException

equals

public boolean equals(Series object)
Tests if this series is equal to the given one and returns true. Otherwise, returns false.

Supported API: true

Specified by:
equals in class Series
Parameters:
object -
Returns:
boolean

lessThan

public boolean lessThan(Series object)
Tests if this series is less than to the given one and returns true. Otherwise, returns false.

Supported API: true

Specified by:
lessThan in class Series
Parameters:
object -
Returns:
boolean

greaterThan

public boolean greaterThan(Series object)
Tests if this series is greater than to the given one and returns true. Otherwise, returns false.

Supported API: true

Specified by:
greaterThan in class Series
Parameters:
object -
Returns:
boolean

getValueIndex

public int getValueIndex()

getSeriesKey

private String getSeriesKey()
                     throws WTException
Throws:
WTException

getSeriesIndex

private int getSeriesIndex(String a_series)
                    throws WTException
Throws:
WTException

getMaturityIndex

private int getMaturityIndex(String a_maturity)
                      throws WTException
Throws:
WTException

getValues

private List getValues(String a_series,
                       String a_maturity)
                throws WTException
Throws:
WTException

isPromote

private boolean isPromote()
                   throws WTException
Throws:
WTException

nextValue

private String nextValue()
                  throws WTException
Throws:
WTException

compare

private int compare(FileBasedSeries series)
             throws WTException
This method was created because we can't trust the maturity level on the series -- 1 can be associated to MILSTD and A to NUMERIC. So, we're not going to trust the maturity on the series itself and will instead calculate based on the actual location of the value in the series.

Parameters:
series -
Returns:
0 if the series are equal, a negative value if this is less than series, and a positive value if this is greater than series
Throws:
WTException - if these can't be compared, to which lessThan/greaterThan will return false