Module opinion_data :: Class Copinions
[hide private]
[frames] | no frames]

Class Copinions

source code

This class encapsulates the opinion layer in KAF/NAF (set of opinions)

Instance Methods [hide private]
 
__get_opinion_nodes(self) source code
 
__init__(self, node=None, type='NAF')
Constructor of the object
source code
 
add_opinion(self, opi_obj)
Adds the opinion object to the layer
source code
xml Element
get_node(self)
Returns the node of the element
source code
Copinion
get_opinions(self)
Iterator that returns all the opinions in the layer
source code
 
remove_this_opinion(self, opinion_id)
Removes the opinion for the given opinion identifier
source code
 
to_kaf(self)
Converts the opinion layer to KAF
source code
 
to_naf(self)
Converts the opinion layer to NAF
source code
Method Details [hide private]

__init__(self, node=None, type='NAF')
(Constructor)

source code 

Constructor of the object

Parameters:
  • node (xml Element or None (to create and empty one)) - this is the node of the element. If it is None it will create a new object
  • type (string) - the type of the object (KAF or NAF)

add_opinion(self, opi_obj)

source code 

Adds the opinion object to the layer

Parameters:
  • opi_obj (Copinion) - the opinion object

get_node(self)

source code 

Returns the node of the element

Returns: xml Element
the node of the element

get_opinions(self)

source code 

Iterator that returns all the opinions in the layer

Returns: Copinion
iterator for the opinions

remove_this_opinion(self, opinion_id)

source code 

Removes the opinion for the given opinion identifier

Parameters:
  • opinion_id (string) - the opinion identifier to be removed