Class 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 Detail

      • AbstractModelDefinition

        public AbstractModelDefinition()
    • Method Detail

      • toString

        public final java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • findSequenceDefinition

        protected SequenceDefinition findSequenceDefinition​(java.lang.String name)
      • 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 interface JMadModelDefinition
        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 the ModelFiles 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 interface ModelFileDependant
        Returns:
        all the required model files