|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.parameters.ParameterSet
de.jstacs.parameters.ExpandableParameterSet
de.jstacs.data.AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet
public static class AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet
Class for the parameters of an array of Alphabet
s where each alphabet may be used for one or more
sections of positions.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class de.jstacs.parameters.ParameterSet |
---|
ParameterSet.ParameterList |
Field Summary |
---|
Fields inherited from class de.jstacs.parameters.ExpandableParameterSet |
---|
commentTemplate, nameTemplate, template |
Fields inherited from class de.jstacs.parameters.ParameterSet |
---|
alternativeInstanceClass, errorMessage, parameters, parent, ranged |
Constructor Summary | |
---|---|
AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet(Alphabet[] alphabets,
int[] indexes,
boolean discrete)
Creates a new SectionDefinedAlphabetParameterSet from an array of Alphabet s,
an array of indexes that define the index of the Alphabet<>/code> in |
|
AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet(boolean discrete)
Creates a new SectionDefinedAlphabetParameterSet for a set of discrete or continuous
alphabets. |
|
AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet(StringBuffer representation)
Creates a new SectionDefinedAlphabetParameterSet from its XML-representation. |
Method Summary | |
---|---|
AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet |
clone()
Creates a full clone (deep copy) of this ParameterSet . |
void |
fromXML(StringBuffer representation)
Parses the instance fields of a ParameterSet from the XML-representation
as returned by ParameterSet.toXML() . |
String |
getInstanceComment()
Returns a comment (a textual description) of the class that can be constructed using this ParameterSet . |
String |
getInstanceName()
Returns the name of an instance of the class that can be constructed using this ParameterSet . |
boolean |
hasDefaultOrIsSet()
Returns true if all parameters in this ParameterSet are
either set by the user or have default values. |
protected void |
loadParameters()
Loads the parameters for this ParameterSet . |
static LinkedList<Integer> |
parseSections(String sections)
Parsed the sections as defined in sections to a list of Integer s. |
StringBuffer |
toXML()
This method returns an XML-representation of an instance of the implementing class. |
Methods inherited from class de.jstacs.parameters.ExpandableParameterSet |
---|
addParameterToSet, parameterRemovable, removeParameterFromSet, replaceContentWith, replaceParametersWithRangedInstance |
Methods inherited from class de.jstacs.parameters.ParameterSet |
---|
getErrorMessage, getId, getInstance, getInstanceClass, getNumberOfParameters, getNumberOfValues, getParameterAt, getParent, initParameterList, initParameterList, isAtomic, isRanged, makeRanged, next, parametersLoaded, propagateId, recieveId, reset, resetToFirst, setAlternativeInstanceClass, setParent, simplify, valuesToString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet(boolean discrete) throws Exception
SectionDefinedAlphabetParameterSet
for a set of discrete or continuous
alphabets.
discrete
- true
if the alphabets may be discrete only
Exception
- is thrown if the Parameter
s could not be createdpublic AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet(Alphabet[] alphabets, int[] indexes, boolean discrete) throws Exception
SectionDefinedAlphabetParameterSet
from an array of Alphabet
s,
an array of indexes that define the index of the Alphabet<>/code> in alphabets/code>
belonging to that position in indexes
and a parameter if the alphabets may be discrete only.
- Parameters:
alphabets
- the alphabetsindexes
- the indexesdiscrete
- true
if the alphabets are discrete
- Throws:
Exception
- is thrown if the Parameter
s could not be created
public AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet(StringBuffer representation) throws NonParsableException
SectionDefinedAlphabetParameterSet
from its XML-representation.
representation
- the XML-representation
NonParsableException
- is thrown if representation
could not be parsedMethod Detail |
---|
protected void loadParameters() throws Exception
ParameterSet
ParameterSet
. This is in
most cases done by simply creating a new ArrayList<Parameter>
for the
field parameters/code>
and filling it with instances of subclasses of Parameter
- Overrides:
loadParameters
in class ExpandableParameterSet
- Throws:
Exception
- an Exception
is thrown if the parameters could not be loaded- See Also:
ParameterSet.parameters
,
Parameter
public StringBuffer toXML()
Storable
toXML
in interface Storable
toXML
in class ExpandableParameterSet
public void fromXML(StringBuffer representation) throws NonParsableException
ParameterSet
ParameterSet
from the XML-representation
as returned by ParameterSet.toXML()
.
fromXML
in class ExpandableParameterSet
representation
- the XML-representation
NonParsableException
- is thrown if the XML-code could not be parsedpublic boolean hasDefaultOrIsSet()
ParameterSet
ParameterSet
are
either set by the user or have default values. If any additional
constraints are required on your parameters you should either specifiy
some ParameterValidator
on these parameters or implement
these contraints by overriding this method in your implementation of
ParameterSet
. It is recommended to specify a useful
remark which constraint failed in the member-variable
errorMessage
, which will be displayed to the user. In the
overriding method super.hasDefaultOrIsSet() should be called prior to
checking specific constraints.
hasDefaultOrIsSet
in class ParameterSet
public static LinkedList<Integer> parseSections(String sections) throws Exception
sections
to a list of Integer
s. Sections may
be defined as ranges (e.g. "3-6"), as lists (e.g. "3,4,5,6"), or as combinations of both
(e.g. ("3-5,6")
sections
- the sections
Exception
- is thrown if sections
could not be parsed, contains a position more than once or
contains positions that are out of rangepublic AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet clone() throws CloneNotSupportedException
ParameterSet
ParameterSet
. As
a convenience-method the user can use
fillWithStandardFieldsForClone(ParameterSet)
on a newly
created instance of a subclass of ParameterSet
to obtain a
clone/copy of all standard member variables (those already defined in
ParameterSet
) in the passed ParameterSet
.
Using this method, the cloning-process becomes merely three-step:ParameterSet
,
most likely with an empty constructor or the one taking just the
instance-class
this.fillWithStandardFieldsForClone
on this
instance
Object
's method clone()
clone
in class ExpandableParameterSet
ParameterSet
CloneNotSupportedException
public String getInstanceName()
ParameterSet
ParameterSet
.
getInstanceName
in class ExpandableParameterSet
public String getInstanceComment()
ParameterSet
ParameterSet
.
getInstanceComment
in class ExpandableParameterSet
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |