EmbASP-Narrative v7.1.0
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

 Handler ()
 
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

Constructor & Destructor Documentation

◆ Handler()

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

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

◆ 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.

◆ collect_options()

List<OptionDescriptor> it.unical.mat.embasp.base.Handler.collect_options ( final List< Integer >  option_index)
inlineprotected

◆ collect_programs()

List<InputProgram> it.unical.mat.embasp.base.Handler.collect_programs ( final List< Integer >  program_index)
inlineprotected

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ startAsync() [1/2]

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

◆ 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.

◆ startSync() [1/2]

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

◆ 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.

Member Data Documentation

◆ options

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

◆ programs

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

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