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 booleancontainsOpticsDefinition(java.lang.String name)protected booleancontainsSequenceDefinition(java.lang.String name)protected SequenceDefinitionfindSequenceDefinition(java.lang.String name)RangeDefinitiongetDefaultRangeDefinition()convenience method to return the default range of the default sequence.OpticsDefinitiongetOpticsDefinition(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 theModelFiles used by this model definition.SequenceDefinitiongetSequenceDefinition(java.lang.String name)retrieves the sequence definition of the given name.java.lang.StringtoString()-
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:
toStringin classjava.lang.Object
-
getSequenceDefinition
public final SequenceDefinition getSequenceDefinition(java.lang.String name)
Description copied from interface:JMadModelDefinitionretrieves the sequence definition of the given name.- Specified by:
getSequenceDefinitionin interfaceJMadModelDefinition- Parameters:
name- the name of the sequence definition- Returns:
- the
SequenceDefinitionif found, null otherwise.
-
findSequenceDefinition
protected SequenceDefinition findSequenceDefinition(java.lang.String name)
-
getRangeDefinitions
public java.util.List<RangeDefinition> getRangeDefinitions()
Description copied from interface:JMadModelDefinitionconvenience method to return all range definitions which are contained in the sequence definitions.- Specified by:
getRangeDefinitionsin interfaceJMadModelDefinition- Returns:
- all the range definitions
-
getDefaultRangeDefinition
public RangeDefinition getDefaultRangeDefinition()
Description copied from interface:JMadModelDefinitionconvenience method to return the default range of the default sequence.- Specified by:
getDefaultRangeDefinitionin interfaceJMadModelDefinition- Returns:
- the default range
-
getOpticsDefinition
public final OpticsDefinition getOpticsDefinition(java.lang.String name)
Description copied from interface:JMadModelDefinitionretrieves the optics definition by its name.- Specified by:
getOpticsDefinitionin 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 theModelFiles 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:
getRequiredFilesin interfaceModelFileDependant- Returns:
- all the required model files
-
-