stella
Class AbstractMerit

java.lang.Object
  extended by util.PropertyContainer
      extended by stella.AbstractMerit
All Implemented Interfaces:
Serializable, Cloneable, Meriting, Initializable, PropertyBearing
Direct Known Subclasses:
AbstractPhaseMerit, AfterPickMerit, AirmassMerit, AtTimeMerit, AvoidanceMerit, BeforeAfterMerit, BlockMerit, ConstantMerit, EvenlySpacedMerit, ExpressionMerit, ForcedSwitchOnMerit, ForcedTimeoutMerit, JdModulusMerit, MeridianMerit, MiddayMerit, MidnightMerit, NightlyMerit, NightStretchMerit, NumberMerit, OneObservationMerit, OppositionMerit, PatternMerit, PerNightMerit, PickRaiseMerit, PriorityMerit, RandomMerit, RepetitiveMerit, SlewTimeMerit, TerminalMerit, UserMerit, WindowMerit, ZenithMerit

public abstract class AbstractMerit
extends PropertyContainer
implements Meriting, Serializable

An abstract meriting class. Its main functionality is creating meriting instances from a class name.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyContainer
PropertyContainer.URLResource
 
Field Summary
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR, KEY_NOINITONCREATE, KEY_RESOURCEBUNDLES
 
Fields inherited from interface util.PropertyBearing
CONFIG, KEY_CLASS, KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
protected AbstractMerit(Map init)
          Protected default constructor.
 
Method Summary
static Meriting createMerit(Map prop)
          Creates a meriting instance from a fully qualified class name.
 Object getInitializer()
          Returns null.
 void initMerit(Object obj)
          Empty method for convenience.
private  void readObject(ObjectInputStream stream)
          On deserialization, first read the hidden object definitions, then the properties of this merit.
private  void writeObject(ObjectOutputStream stream)
          We customize object serialization.
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, clone, createFrom, createFrom, createFrom, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getLocalClassLoader, getLocalized, getLocalized, getLocalizedString, getLocalizedString, getProperties, getPropertiesToKey, getPropertiesToKey, getProperty, getResource, getResourceAsStream, getResourceFromKey, getResources, has, init, isNew, keyCreate, keyCreate, parseObject, reload, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface stella.Meriting
getMerit
 

Constructor Detail

AbstractMerit

protected AbstractMerit(Map init)
Protected default constructor. Note that construction using an exisiting properties object is not supported. All information must be plunged into the property container either in the default subclasses constructor or later with the PropertyContainer.setProperty(java.lang.String, java.lang.String) method.

Method Detail

createMerit

public static Meriting createMerit(Map prop)
Creates a meriting instance from a fully qualified class name. The class must support the default constructor.


initMerit

public void initMerit(Object obj)
Empty method for convenience. The very few classes that need initialization must override this method.

Specified by:
initMerit in interface Meriting
Parameters:
obj - An object used for initialization.

getInitializer

public Object getInitializer()
Returns null. If subclasses realy need an initializer, they should also override this method.

Specified by:
getInitializer in interface Meriting
Returns:
null if no initializer is needed.

writeObject

private void writeObject(ObjectOutputStream stream)
                  throws IOException
We customize object serialization. We serialize out properties.

Throws:
IOException

readObject

private void readObject(ObjectInputStream stream)
                 throws IOException,
                        ClassNotFoundException
On deserialization, first read the hidden object definitions, then the properties of this merit. The merit properties are then set using PropertyContainer.setProperties(java.util.Map).

Throws:
IOException
ClassNotFoundException