Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Many keywords in Odysseus Scripts supports or needs the definition of parameters. There is an existing parser class, that supports an easy definition and parsing of these parameters. The following steps are needed, to use this parser.

1. Creating the parameter enum. This enum needs to implement the Interface IKeywordParameter and the needed methods

Code Block
package de.uniol.inf.is.odysseus.parallelization.parameter;


import de.uniol.inf.is.odysseus.script.parser.parameter.IKeywordParameter;

public enum ParallelizationKeywordParameter implements IKeywordParameter{
	PARALLELIZATION_TYPE("type", 0, false),
	DEGREE_OF_PARALLELIZATION("degree", 1, false), 
	BUFFERSIZE("buffersize", 2, false), 
	OPTIMIZATION("optimization", 3, true),
	THREADEDBUFFER("threadedbuffer", 4, true);

	private ParallelizationKeywordParameter(String name, int position, boolean isOptional){
		this.name = name;
		this.position = position;
		this.isOptional = isOptional;
	}

	private String name;
	private Integer position;
	private boolean isOptional;

	@Override
	public String getName() {
		return this.name;
	}

	@Override
	public int getPosition() {
		return this.position;
	}

	@Override
	public boolean isOptional() {
		return this.isOptional;
	}
}