public abstract class Handler
extends java.lang.Object
InputProgram
and OptionDescriptor
.
The subclasses have to implement startAsync(Callback, List, List)
and startSync(List, List)
methods.
Each instance inside programs
and options
are represented by an integer (id) , respectively.ArrayList
,
HashMap
,
List
,
Map
Constructor and Description |
---|
Handler() |
Modifier and Type | Method and Description |
---|---|
int |
addOption(OptionDescriptor o)
Add a new element inside
options set. |
int |
addProgram(InputProgram program)
Add a new element inside
programs set. |
InputProgram |
getInputProgram(int key)
Returns the specified
InputProgram element |
OptionDescriptor |
getOptionDescriptor(int key)
Returns the specified
OptionDescriptor element |
void |
removeAll()
|
void |
removeOption(int option_id)
Removes the element associate within the given id from
options set. |
boolean |
removeOption(OptionDescriptor o)
Removes every occurrence of a specified
OptionDescriptor element from options set. |
boolean |
removeProgram(InputProgram p)
Removes every occurrence of a specified
InputProgram element from programs set. |
void |
removeProgram(int program_id)
Removes the element associate within the given id from
programs set. |
void |
startAsync(Callback c) |
void |
startAsync(Callback c,
java.util.List<java.lang.Integer> program_index,
java.util.List<java.lang.Integer> option_index)
This method have to be implemented by subclasses to execute solver in a asynchronous way, if no parameters are given
the entire sets of programs and option are used
|
Output |
startSync() |
Output |
startSync(java.util.List<java.lang.Integer> program_index,
java.util.List<java.lang.Integer> option_index)
This method have to be implemented by subclasses to execute solver in a synchronous way, if no parameters are given
the entire sets of programs and option are used
|
public int addOption(OptionDescriptor o)
options
set.o
- is the new OptionDescriptor
instanceOptionDescriptor
instancepublic int addProgram(InputProgram program)
programs
set.program
- is the InputProgram
instance added to the collection.InputProgram
instance.public InputProgram getInputProgram(int key)
InputProgram
elementkey
- the idInputProgram
element associate with the given keypublic OptionDescriptor getOptionDescriptor(int key)
OptionDescriptor
elementkey
- the idOptionDescriptor
element associate with the given keypublic void removeAll()
public void removeOption(int option_id)
options
set.option_id
- the id associate within an elementpublic boolean removeOption(OptionDescriptor o)
OptionDescriptor
element from options
set.o
- element to be removedpublic boolean removeProgram(InputProgram p)
InputProgram
element from programs
set.p
- element to be removedpublic void removeProgram(int program_id)
programs
set.program_id
- the id associate within an elementpublic void startAsync(Callback c, java.util.List<java.lang.Integer> program_index, java.util.List<java.lang.Integer> option_index)
public Output startSync()
startSync(List, List)
public Output startSync(java.util.List<java.lang.Integer> program_index, java.util.List<java.lang.Integer> option_index)
Service