Class MultipleSelectionFragment

  • All Implemented Interfaces:
    IArtifact, IVilType

    public class MultipleSelectionFragment
    extends VariabilityFragment
    Represents a multiple selection fragment.
    Author:
    Holger Eichelberger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accept​(IArtifactVisitor visitor)
      Visits this artifact (and dependent on the visitor also contained artifacts and fragments) using the given visitor.
      void delete()
      Deletes this artifact.
      FragmentArtifact getAlternative​(int index)
      Returns the specified alternative fragment.
      int getAlternativesCount()
      Returns the number of alternative fragments.
      Binary getBinary()
      Returns the binary representation of the contents of this artifact for manipulation.
      java.lang.String getName()
      Returns the name of this artifact.
      Text getText()
      Returns the textual representation of the contents of this artifact for manipulation.
      void rename​(java.lang.String name)
      Renames this artifact.
      void update()
      Called if the underlying real artifact may have been updated, e.g., by overriding it by another file.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MultipleSelectionFragment

        MultipleSelectionFragment​(FragmentArtifact[] alternatives)
        Creates a new fragment artifact from given alternative fragments.
        Parameters:
        alternatives - the alternative fragments
    • Method Detail

      • getAlternativesCount

        public int getAlternativesCount()
        Returns the number of alternative fragments.
        Returns:
        the number of alternatives
      • getAlternative

        public FragmentArtifact getAlternative​(int index)
        Returns the specified alternative fragment.
        Parameters:
        index - the index of the alternative to be returned
        Returns:
        the specified alternative fragment
        Throws:
        java.lang.IndexOutOfBoundsException - if 0 < index || index >=getAlternativesCount()
      • delete

        public void delete()
                    throws VilException
        Description copied from interface: IArtifact
        Deletes this artifact.
        Throws:
        VilException - in case of serious problems so that this operation cannot continue
      • getName

        public java.lang.String getName()
                                 throws VilException
        Description copied from interface: IArtifact
        Returns the name of this artifact.
        Returns:
        the name of this artifact
        Throws:
        VilException - in case of serious problems so that this operation cannot continue
      • rename

        public void rename​(java.lang.String name)
                    throws VilException
        Description copied from interface: IArtifact
        Renames this artifact.
        Parameters:
        name - the new name of this artifact
        Throws:
        VilException - in case of serious problems so that this operation cannot continue
      • getText

        public Text getText()
                     throws VilException
        Description copied from interface: IArtifact
        Returns the textual representation of the contents of this artifact for manipulation. In case of binary artifacts, the returned object may be empty.
        Returns:
        the textual representation of the contents
        Throws:
        VilException - in case of obtaining the representation causes serious problems
      • getBinary

        public Binary getBinary()
                         throws VilException
        Description copied from interface: IArtifact
        Returns the binary representation of the contents of this artifact for manipulation.
        Returns:
        the binary representation of the contents
        Throws:
        VilException - in case of obtaining the representation causes serious problems
      • accept

        public void accept​(IArtifactVisitor visitor)
        Description copied from interface: IArtifact
        Visits this artifact (and dependent on the visitor also contained artifacts and fragments) using the given visitor.
        Specified by:
        accept in interface IArtifact
        Overrides:
        accept in class VariabilityFragment
        Parameters:
        visitor - the visitor used for visiting this artifact
      • update

        public void update()
                    throws VilException
        Description copied from interface: IArtifact
        Called if the underlying real artifact may have been updated, e.g., by overriding it by another file.
        Throws:
        VilException - in case that updating fails