com.greenpepper.interpreter.flow.action.Action Maven / Gradle / Ivy
package com.greenpepper.interpreter.flow.action;
import java.util.ArrayList;
import java.util.List;
import com.greenpepper.Example;
import com.greenpepper.interpreter.flow.AbstractAction;
import com.greenpepper.util.ExampleUtil;
/**
* Action class.
*
* @author oaouattara
* @version $Id: $Id
*/
public class Action extends AbstractAction
{
/**
* Constructor for Action.
*
* @param cells a {@link java.lang.Iterable} object.
*/
public Action(Iterable cells)
{
super(cells);
}
/**
* parse.
*
* @param cells a {@link java.util.List} object.
* @return a {@link com.greenpepper.interpreter.flow.action.Action} object.
*/
public static Action parse(List cells)
{
return new Action( ExampleUtil.contentAsList(cells) );
}
/**
* keywords.
*
* @return a {@link java.util.List} object.
*/
protected List keywords()
{
return cellsAsList().subList(0, 1);
}
/**
* parameters.
*
* @return a {@link java.util.List} object.
*/
protected List parameters()
{
List cellsAsList = cellsAsList();
return cellsAsList.subList(1, cellsAsList.size());
}
private List cellsAsList()
{
List parameters = new ArrayList();
for (String cell : getCells()) {
parameters.add(cell);
}
return parameters;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy