EmbASP-Java
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
it.unical.mat.embasp.base.Handler Class Referenceabstract
Inheritance diagram for it.unical.mat.embasp.base.Handler:
it.unical.mat.embasp.platforms.android.AndroidHandler it.unical.mat.embasp.platforms.desktop.DesktopHandler

Public Member Functions

int addOption (final OptionDescriptor o)
 
int addProgram (final InputProgram program)
 
InputProgram getInputProgram (final int key)
 
OptionDescriptor getOptionDescriptor (final int key)
 
void removeAll ()
 
void removeOption (final int option_id)
 
boolean removeOption (final OptionDescriptor o)
 
boolean removeProgram (final InputProgram p)
 
void removeProgram (final int program_id)
 
void startAsync (final Callback c)
 
void startAsync (final Callback c, final List< Integer > program_index, final List< Integer > option_index)
 
Output startSync ()
 
Output startSync (final List< Integer > program_index, final List< Integer > option_index)
 

Protected Member Functions

List< OptionDescriptorcollect_options (final List< Integer > option_index)
 
List< InputProgramcollect_programs (final List< Integer > program_index)
 

Protected Attributes

Map< Integer, InputProgramprograms
 
Map< Integer, OptionDescriptoroptions
 

Detailed Description

A collection of 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.

See also
ArrayList
HashMap
List
Map

Definition at line 19 of file Handler.java.

Member Function Documentation

◆ addOption()

int it.unical.mat.embasp.base.Handler.addOption ( final OptionDescriptor  o)
inline

Add a new element inside options set.

Parameters
ois the new OptionDescriptor instance
Returns
the id associate to the new added OptionDescriptor instance

Definition at line 44 of file Handler.java.

◆ addProgram()

int it.unical.mat.embasp.base.Handler.addProgram ( final InputProgram  program)
inline

Add a new element inside programs set.

Parameters
programis the InputProgram instance added to the collection.
Returns
the id associate to the new added InputProgram instance.

Definition at line 60 of file Handler.java.

◆ getInputProgram()

InputProgram it.unical.mat.embasp.base.Handler.getInputProgram ( final int  key)
inline

Returns the specified InputProgram element

Parameters
keythe id
Returns
InputProgram element associate with the given key

Definition at line 100 of file Handler.java.

◆ getOptionDescriptor()

OptionDescriptor it.unical.mat.embasp.base.Handler.getOptionDescriptor ( final int  key)
inline

Returns the specified OptionDescriptor element

Parameters
keythe id
Returns
OptionDescriptor element associate with the given key

Definition at line 111 of file Handler.java.

◆ removeAll()

void it.unical.mat.embasp.base.Handler.removeAll ( )
inline

Removes all of the elements from programs and options.Both of the collections will be empty after this method returns

Definition at line 116 of file Handler.java.

◆ removeOption() [1/2]

void it.unical.mat.embasp.base.Handler.removeOption ( final int  option_id)
inline

Removes the element associate within the given id from options set.

Parameters
option_idthe id associate within an element

Definition at line 129 of file Handler.java.

◆ removeOption() [2/2]

boolean it.unical.mat.embasp.base.Handler.removeOption ( final OptionDescriptor  o)
inline

Removes every occurrence of a specified OptionDescriptor element from options set.

Parameters
oelement to be removed
Returns
true if one or more elements are removed , false otherwise

Definition at line 142 of file Handler.java.

◆ removeProgram() [1/2]

boolean it.unical.mat.embasp.base.Handler.removeProgram ( final InputProgram  p)
inline

Removes every occurrence of a specified InputProgram element from programs set.

Parameters
pelement to be removed
Returns
true if one or more elements are removed , false otherwise

Definition at line 163 of file Handler.java.

◆ removeProgram() [2/2]

void it.unical.mat.embasp.base.Handler.removeProgram ( final int  program_id)
inline

Removes the element associate within the given id from programs set.

Parameters
program_idthe id associate within an element

Definition at line 181 of file Handler.java.

◆ startAsync() [1/2]

void it.unical.mat.embasp.base.Handler.startAsync ( final Callback  c)
inline
See also
Service

Reimplemented in it.unical.mat.embasp.platforms.android.AndroidHandler.

Definition at line 187 of file Handler.java.

◆ startAsync() [2/2]

void it.unical.mat.embasp.base.Handler.startAsync ( final Callback  c,
final List< Integer >  program_index,
final List< Integer >  option_index 
)
inline

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

Reimplemented in it.unical.mat.embasp.platforms.desktop.DesktopHandler, and it.unical.mat.embasp.platforms.android.AndroidHandler.

Definition at line 195 of file Handler.java.

◆ startSync() [1/2]

Output it.unical.mat.embasp.base.Handler.startSync ( )
inline
See also
#startSync(List, List)

Definition at line 199 of file Handler.java.

◆ startSync() [2/2]

Output it.unical.mat.embasp.base.Handler.startSync ( final List< Integer >  program_index,
final List< Integer >  option_index 
)
inline

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

See also
Service

Reimplemented in it.unical.mat.embasp.platforms.desktop.DesktopHandler.

Definition at line 210 of file Handler.java.

Member Data Documentation

◆ options

Map<Integer, OptionDescriptor> it.unical.mat.embasp.base.Handler.options
protected
Parameters
optionis where OptionDescriptor elements are stored

Definition at line 29 of file Handler.java.

◆ programs

Map<Integer, InputProgram> it.unical.mat.embasp.base.Handler.programs
protected
Parameters
programsis where InputProgram elements are stored.

Definition at line 24 of file Handler.java.


The documentation for this class was generated from the following file: