Class AbstractModelDefinition
- java.lang.Object
-
- cern.accsoft.steering.jmad.modeldefs.domain.AbstractModelDefinition
-
- All Implemented Interfaces:
ModelFileDependant
,JMadModelDefinition
- Direct Known Subclasses:
JMadModelDefinitionImpl
public abstract class AbstractModelDefinition extends java.lang.Object implements JMadModelDefinition
A Model definition consists of a (arbitrary) number of initialization - files (madx files) and contains an arbitrary number of sequence-names. This is the abstract version of a model definition. It implements lazy loading for almost all properties to ensure, that they are created only when they are needed, only once and reused afterwards. All the create... methods have to be overridden by the subclasses. NOTE: It is important that that class stays at the same resource-location, since all the resource-paths are calculated relative to this class!
-
-
Constructor Summary
Constructors Constructor Description AbstractModelDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
containsOpticsDefinition(java.lang.String name)
protected boolean
containsSequenceDefinition(java.lang.String name)
protected SequenceDefinition
findSequenceDefinition(java.lang.String name)
RangeDefinition
getDefaultRangeDefinition()
convenience method to return the default range of the default sequence.OpticsDefinition
getOpticsDefinition(java.lang.String name)
retrieves the optics definition by its name.java.util.List<RangeDefinition>
getRangeDefinitions()
convenience method to return all range definitions which are contained in the sequence definitions.java.util.Collection<ModelFile>
getRequiredFiles()
Returns all theModelFile
s used by this model definition.SequenceDefinition
getSequenceDefinition(java.lang.String name)
retrieves the sequence definition of the given name.java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface cern.accsoft.steering.jmad.modeldefs.domain.JMadModelDefinition
getDefaultOpticsDefinition, getDefaultSequenceDefinition, getInitFiles, getModelPackUri, getModelPathOffsets, getName, getOpticsDefinitions, getSequenceDefinitions, getSourceInformation
-
-
-
-
Method Detail
-
toString
public final java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getSequenceDefinition
public final SequenceDefinition getSequenceDefinition(java.lang.String name)
Description copied from interface:JMadModelDefinition
retrieves the sequence definition of the given name.- Specified by:
getSequenceDefinition
in interfaceJMadModelDefinition
- Parameters:
name
- the name of the sequence definition- Returns:
- the
SequenceDefinition
if found, null otherwise.
-
findSequenceDefinition
protected SequenceDefinition findSequenceDefinition(java.lang.String name)
-
getRangeDefinitions
public java.util.List<RangeDefinition> getRangeDefinitions()
Description copied from interface:JMadModelDefinition
convenience method to return all range definitions which are contained in the sequence definitions.- Specified by:
getRangeDefinitions
in interfaceJMadModelDefinition
- Returns:
- all the range definitions
-
getDefaultRangeDefinition
public RangeDefinition getDefaultRangeDefinition()
Description copied from interface:JMadModelDefinition
convenience method to return the default range of the default sequence.- Specified by:
getDefaultRangeDefinition
in interfaceJMadModelDefinition
- Returns:
- the default range
-
getOpticsDefinition
public final OpticsDefinition getOpticsDefinition(java.lang.String name)
Description copied from interface:JMadModelDefinition
retrieves the optics definition by its name.- Specified by:
getOpticsDefinition
in interfaceJMadModelDefinition
- Parameters:
name
- the name of the opticsDefinition- Returns:
- the opticsDefinition if found, null otherwise
-
containsSequenceDefinition
protected boolean containsSequenceDefinition(java.lang.String name)
-
containsOpticsDefinition
protected boolean containsOpticsDefinition(java.lang.String name)
-
getRequiredFiles
public final java.util.Collection<ModelFile> getRequiredFiles()
Returns all theModelFile
s used by this model definition.DANGER: This does not return all required files, but only the init files, which is correct since this is only the implementation for ModelFileDependant - interfsace. To get ALL the required files use
ModelDefinitionUtil
- Specified by:
getRequiredFiles
in interfaceModelFileDependant
- Returns:
- all the required model files
-
-