Class Imports<M extends IModel>
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.common.Imports<M>
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ModelImport<M>>imports
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(ModelImport<M> imp)Adds an import.ModelImport<M>getImport(int index)Get the parameter of this template at the specified index.ModelImport<M>getImport(java.lang.String name)Returns an import matching the givenname.intgetImportsCount()Get the number of imports of this template.
-
-
-
Field Detail
-
imports
private java.util.List<ModelImport<M extends IModel>> imports
-
-
Constructor Detail
-
Imports
Imports()
Constructor for serialization.
-
Imports
public Imports(java.util.List<ModelImport<M>> imports)
Creates an imports instance.- Parameters:
imports- the actual imports
-
-
Method Detail
-
getImportsCount
public int getImportsCount()
Get the number of imports of this template.- Returns:
- The number of imports of this template.
-
getImport
public ModelImport<M> getImport(int index)
Get the parameter of this template at the specified index.- Parameters:
index- The 0-based index of the import to be returned.- Returns:
- The import at the given index.
- Throws:
java.lang.IndexOutOfBoundsException- ifindex < 0 || index >=getImportsCount()
-
getImport
public ModelImport<M> getImport(java.lang.String name)
Returns an import matching the givenname.- Parameters:
name- the name to search for- Returns:
- the matching import or null
-
add
public void add(ModelImport<M> imp)
Adds an import.- Parameters:
imp- the import to be added
-
-