Class ListVariableDeclarationReceiver<I extends IResolvable>
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.common.ListVariableDeclarationReceiver<I>
-
- Type Parameters:
I- the variable type
- All Implemented Interfaces:
IVariableDeclarationReceiver<I>
public class ListVariableDeclarationReceiver<I extends IResolvable> extends java.lang.Object implements IVariableDeclarationReceiver<I>
Implements a simple list variable declaration receiver.- Author:
- Holger Eichelberger
-
-
Constructor Summary
Constructors Constructor Description ListVariableDeclarationReceiver()Creates a receiver.ListVariableDeclarationReceiver(int size)Creates a receiver of given initial size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddVariableDeclaration(I var)Adds a variable declaration.IgetVariable(int index)Returns the specified variable.intgetVariableCount()Returns the number of variables.I[]toArray()Turns the collected variables into an array.
-
-
-
Field Detail
-
variables
private java.util.List<I extends IResolvable> variables
-
-
Method Detail
-
addVariableDeclaration
public void addVariableDeclaration(I var)
Description copied from interface:IVariableDeclarationReceiverAdds a variable declaration.- Specified by:
addVariableDeclarationin interfaceIVariableDeclarationReceiver<I extends IResolvable>- Parameters:
var- the variable declaration
-
getVariableCount
public int getVariableCount()
Returns the number of variables.- Returns:
- the number of variables
-
getVariable
public I getVariable(int index)
Returns the specified variable.- Parameters:
index- the 0-based index of the variable- Returns:
- the specified variable
- Throws:
java.lang.IndexOutOfBoundsException- ifindex < 0 || index >=getVariableCount()
-
toArray
public I[] toArray()
Turns the collected variables into an array.- Returns:
- the array
-
-