Class MultipleSelectionFragment
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.artifactModel.FragmentArtifact
-
- net.ssehub.easy.instantiation.core.model.artifactModel.variability.VariabilityFragment
-
- net.ssehub.easy.instantiation.core.model.artifactModel.variability.MultipleSelectionFragment
-
public class MultipleSelectionFragment extends VariabilityFragment
Represents a multiple selection fragment.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private FragmentArtifact[]alternatives
-
Constructor Summary
Constructors Constructor Description MultipleSelectionFragment(FragmentArtifact[] alternatives)Creates a new fragment artifact from given alternative fragments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(IArtifactVisitor visitor)Visits this artifact (and dependent on the visitor also contained artifacts and fragments) using the given visitor.voiddelete()Deletes this artifact.FragmentArtifactgetAlternative(int index)Returns the specified alternative fragment.intgetAlternativesCount()Returns the number of alternative fragments.BinarygetBinary()Returns the binary representation of the contents of this artifact for manipulation.java.lang.StringgetName()Returns the name of this artifact.TextgetText()Returns the textual representation of the contents of this artifact for manipulation.voidrename(java.lang.String name)Renames this artifact.voidupdate()Called if the underlying real artifact may have been updated, e.g., by overriding it by another file.-
Methods inherited from class net.ssehub.easy.instantiation.core.model.artifactModel.FragmentArtifact
exists, lastModification, store
-
-
-
-
Field Detail
-
alternatives
private FragmentArtifact[] alternatives
-
-
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- if0 < index || index >=getAlternativesCount()
-
delete
public void delete() throws VilExceptionDescription copied from interface:IArtifactDeletes this artifact.- Throws:
VilException- in case of serious problems so that this operation cannot continue
-
getName
public java.lang.String getName() throws VilExceptionDescription copied from interface:IArtifactReturns 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 VilExceptionDescription copied from interface:IArtifactRenames 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:IArtifactReturns 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:IArtifactReturns 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:IArtifactVisits this artifact (and dependent on the visitor also contained artifacts and fragments) using the given visitor.- Specified by:
acceptin interfaceIArtifact- Overrides:
acceptin classVariabilityFragment- Parameters:
visitor- the visitor used for visiting this artifact
-
update
public void update() throws VilExceptionDescription copied from interface:IArtifactCalled if the underlying real artifact may have been updated, e.g., by overriding it by another file.- Throws:
VilException- in case that updating fails
-
-