Package muntjac :: Package data :: Package util :: Module indexed_container :: Class IndexedContainerItem
[hide private]
[frames] | no frames]

Class IndexedContainerItem

source code

object --+    
         |    
item.IItem --+
             |
            IndexedContainerItem

Instance Methods [hide private]
 
__init__(self, itemId, container)
Constructs a new ListItem instance and connects it to a host container.
source code
 
getItemProperty(self, idd)
Gets the Property corresponding to the given Property ID stored in the IItem.
source code
 
getItemPropertyIds(self)
Gets the collection of IDs of all Properties stored in the IItem.
source code
 
__str__(self)
Gets the string representation of the contents of the IItem.
source code
 
__hash__(self)
Calculates a integer hash-code for the IItem that's unique inside the list.
source code
 
__eq__(self, obj)
Tests if the given object is the same as the this object.
source code
 
getHost(self) source code
 
addItemProperty(self, idd, prop)
IndexedContainerItem does not support adding new properties.
source code
 
removeItemProperty(self, idd)
Indexed container does not support removing properties.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, itemId, container)
(Constructor)

source code 

Constructs a new ListItem instance and connects it to a host container.

Parameters:
  • itemId - the IItem ID of the new IItem.
Overrides: object.__init__

getItemProperty(self, idd)

source code 

Gets the Property corresponding to the given Property ID stored in the IItem. If the IItem does not contain the Property, None is returned.

Parameters:
  • idd - identifier of the Property to get
Returns:
the Property with the given ID or None
Overrides: item.IItem.getItemProperty
(inherited documentation)

getItemPropertyIds(self)

source code 

Gets the collection of IDs of all Properties stored in the IItem.

Returns:
iterable containing IDs of the Properties stored the IItem
Overrides: item.IItem.getItemPropertyIds
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

Gets the string representation of the contents of the IItem. The format of the string is a space separated catenation of the string representations of the Properties contained by the IItem.

Returns:
string representation of the IItem contents
Overrides: object.__str__

__hash__(self)
(Hashing function)

source code 

Calculates a integer hash-code for the IItem that's unique inside the list. Two Items inside the same list have always different hash-codes, though Items in different lists may have identical hash-codes.

Returns:
A locally unique hash-code as integer
Overrides: object.__hash__

__eq__(self, obj)
(Equality operator)

source code 

Tests if the given object is the same as the this object. Two Items got from a list container with the same ID are equal.

Parameters:
  • obj - an object to compare with this object
Returns:
True if the given object is the same as this object, False if not

addItemProperty(self, idd, prop)

source code 

IndexedContainerItem does not support adding new properties. Add properties at container level. See IndexedContainer.addContainerProperty

Parameters:
  • idd - ID of the new Property
  • prop - the Property to be added and associated with the id
Returns:
True if the operation succeeded, False if not
Raises:
  • NotImplementedError - if the operation is not supported.
Overrides: item.IItem.addItemProperty

See Also: IItem.addProperty

removeItemProperty(self, idd)

source code 

Indexed container does not support removing properties. Remove properties at container level. See IndexedContainer.removeContainerProperty

Parameters:
  • idd - ID of the Property to be removed
Returns:
True if the operation succeeded False if not
Raises:
  • NotImplementedError - if the operation is not supported.
Overrides: item.IItem.removeItemProperty

See Also: IItem.removeProperty