Package bar :: Module atlas_indexer :: Class barIndexerGroupElement
[hide private]
[frames] | no frames]

Class barIndexerGroupElement


Class of objects representing 'group' elements of CAF dataset index file.

Nested Classes [hide private]
Instance Methods [hide private]
 
__init__(self, **kwargs)
Accepted keyword arguments:
str
__getName(self)
Returns: value of the 'name' attribute of represented XML element
 
__setName(self, newName)
Set the value of the 'name' attribute of represented XML element.
int
__getGID(self)
Returns: value of the 'id' attribute of represented XML element
 
__setGID(self, newID)
Set value of the 'id' attribute of represented XML element.
str
__getFill(self)
Returns: value of the 'fill' attribute of represented XML element
 
__setFill(self, newFill)
Set value of the 'fill' attribute of represented XML element.
str
__getFullname(self)
Returns: value of the 'fullname' attribute of represented XML element
 
__setFullname(self, newFullName)
Set value of the 'fullname' attribute of represented XML element.
int
__getUID(self)
Returns: value of the 'uid' attribute of represented XML element
 
__setUID(self, newUID)
Set value of the 'uid' attribute of represented XML element.
barIndexerStructureElement
__getStructure(self)
Returns: object representing the 'structure' element related to represented element
 
__setStructure(self, newStructure)
Assign _structure an object representing the 'structure' element related to represented element.
[int, ...]
__getUidList(self)
Return list of 'uid' attributes of 'structure' elements assigned to the represented element.
 
__setUidList(self, newValues)
Raise ValueError.
 
getXMLelement(self)
Returns: dom XML object describing the object
generator
getStructureNameIterator(self, depth=999)
Returns: iterator over names of structures composing the group in the hierarchy tree deep up to the given depth
generator
getVisibleGroupIterator(self, depth=999, leavesOnly=False)
Returns: iterator over groups ascendant to any structure included in CAF slides in the hierarchy tree deep up to the given depth
 
getChildList(self, depth=1)
An alias for self.__getMappedChildList(depth, ('name',))
 
getNameUidChildList(self, depth=1)
An alias for self.__getMappedChildList(depth, ('name', 'id'))
 
getNameFullNameUid(self, depth=1)
An alias for self.__getMappedChildList(depth, ('name', 'fullname', 'id'))
str
printHierarchyTree(self, depth=0)
Print hierarchy tree of 'group' elements rooted in the represented element.
 
nextSibling(self)
An alias for self._getSibling(+1).
 
prevSibling(self)
An alias for self._getSibling(-1).
barIndexerGroupElement
_getSibling(self, direction=-1)
Returns: next (if direction = +1) or previous (if direction = -1) sibling of given group element.
tuple
__getMappedChildList(self, depth=1, properties=('name', 'id'))
Returns: tuple-based hierarchy tree containing tuples with requested attributes of 'group' elements rooted in the represented element

Inherited from base.barObject: __str__, getElementById, writeXMLtoFile

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

Class Methods [hide private]
cls
fromXML(cls, sourceXMLElement, indexer=None)
Creates object from its (valid) xml representation.
Static Methods [hide private]

Inherited from base.barObject (private): _getAttributesDict

Class Variables [hide private]
str _elementName = 'group'
name of the XML element represented by class instances
[str, ...] _elementAttributes = ['name', 'id', 'fill', 'fullname', 'uid',...
names of attributes of the XML element represented by class instances
Instance Variables [hide private]
str _fill
value of the 'fill' attribute of represented XML element
str _fullname
value of the 'fullname' attribute of represented XML element
int _id
value of the 'id' attribute of represented XML element
str _name
value of the 'name' attribute of represented XML element
barIndexerStructureElement _structure
object handling manipulation of the 'structure' element related to the represented element; its uid value overrides the _uid value if given
int _uid
value of the 'uid' attribute of represented XML element
[barIndexerGroupElement, ...] children
objects handling manipulations of the 'group' elements child to the represented element
barIndexerGroupElement parent
object handling manipulations of the 'group' element parental to the represented element
Properties [hide private]
str name
The 'name' attribute of represented XML element.
int id
The 'id' attribute of represented XML element.
str fill
The 'fill' attribute of represented XML element.
str fullname
The 'fullname' attribute of represented XML element.
int uid
The 'uid' attribute of represented XML element.
[int, ...] uidList
List of 'uid' attributes of 'structure' elements assigned to the represented element.
barIndexerStructureElement structure
Object representing 'structure' element related to the represented element.

Inherited from object: __class__

Method Details [hide private]

__init__(self, **kwargs)
(Constructor)

 

Accepted keyword arguments:

  • 'name' (str) - value of the 'name' attribute of represented XML element,
  • 'id' (int) - value of the 'id' attribute of represented XML element,
  • 'fill' (str) - value of the 'fill' attribute of represented XML element,
  • 'fullname' (str) - value of the 'fullname' attribute of represented XML element,
  • 'uid' (int) - value of the 'uid' attribute of represented XML element,
  • 'structure' (barIndexerStructureElement) - object handling manipulation of the structure related to the group; its uid overrides the uid argument if given,
  • 'ontologyid' - value of the 'ontologyid' of represented XML.
Overrides: object.__init__

__getName(self)

 
Returns: str
value of the 'name' attribute of represented XML element

__setName(self, newName)

 

Set the value of the 'name' attribute of represented XML element.

Parameters:
  • newName (str) - a new value of the 'name' attribute of represented XML element

__getGID(self)

 
Returns: int
value of the 'id' attribute of represented XML element

__setGID(self, newID)

 

Set value of the 'id' attribute of represented XML element.

Parameters:
  • newID (int) - value of the 'id' attribute of represented XML element

__getFill(self)

 
Returns: str
value of the 'fill' attribute of represented XML element

__setFill(self, newFill)

 

Set value of the 'fill' attribute of represented XML element.

Parameters:
  • newFill (str) - value of the 'fill' attribute of represented XML element

__getFullname(self)

 
Returns: str
value of the 'fullname' attribute of represented XML element

__setFullname(self, newFullName)

 

Set value of the 'fullname' attribute of represented XML element.

Parameters:
  • newFullName (str) - value of the 'fullname' attribute of represented XML element

__getUID(self)

 
Returns: int
value of the 'uid' attribute of represented XML element

__setUID(self, newUID)

 

Set value of the 'uid' attribute of represented XML element.

Parameters:
  • newUID (int) - value of the 'uid' attribute of represented XML element

Note: If _structure is assigned the ValueError is raisen.

__getStructure(self)

 
Returns: barIndexerStructureElement
object representing the 'structure' element related to represented element

__setStructure(self, newStructure)

 

Assign _structure an object representing the 'structure' element related to represented element.

Parameters:

__getUidList(self)

 

Return list of 'uid' attributes of 'structure' elements assigned to the represented element. 'structure' elements are gathered from all children as well as from the root element.

Returns: [int, ...]
identifiers of 'structure' elements related to the represented hierarchy group.

getXMLelement(self)

 

A stub of method. Raise NotImplementedError.

Returns:
dom XML object describing the object
Overrides: base.barObject.getXMLelement
(inherited documentation)

fromXML(cls, sourceXMLElement, indexer=None)
Class Method

 

Creates object from its (valid) xml representation.

Parameters:
  • sourceXMLElement (xml.dom.Node) - XML description of the barIndexerGroupElement object to be created.
  • indexer (barIndexer) - the object encapsulating returned class instance
Returns: cls
Object based on sourceXMLElement description.
Overrides: barIndexerObject.fromXML

getStructureNameIterator(self, depth=999)

 
Parameters:
  • depth (int) - hierarchy tree iteration depth limit
Returns: generator
iterator over names of structures composing the group in the hierarchy tree deep up to the given depth

getVisibleGroupIterator(self, depth=999, leavesOnly=False)

 
Parameters:
  • depth (int) - hierarchy tree iteration depth limit
  • leavesOnly (bool) - True if requested to iterate over names of the leaves of the iteration tree only, False otherwise
Returns: generator
iterator over groups ascendant to any structure included in CAF slides in the hierarchy tree deep up to the given depth

printHierarchyTree(self, depth=0)

 

Print hierarchy tree of 'group' elements rooted in the represented element.

Parameters:
  • depth (int) - level of nesting - margin for printing
Returns: str
tree representation of hierarchy

_getSibling(self, direction=-1)

 
Parameters:
  • direction (int) - determines, if next or previous sibling is returned
Returns: barIndexerGroupElement
next (if direction = +1) or previous (if direction = -1) sibling of given group element. If given group element has no parent, the element itself is returned.

__getMappedChildList(self, depth=1, properties=('name', 'id'))

 
Parameters:
  • depth (int) - height of the returned hierarchy tree
  • properties ((str, ...)) - requested attribute names
Returns: tuple
tuple-based hierarchy tree containing tuples with requested attributes of 'group' elements rooted in the represented element

Class Variable Details [hide private]

_elementAttributes

names of attributes of the XML element represented by class instances
Type:
[str, ...]
Value:
['name', 'id', 'fill', 'fullname', 'uid', 'ontologyid']

Property Details [hide private]

name

The 'name' attribute of represented XML element.

Get Method:
__getName(self) - Returns: value of the 'name' attribute of represented XML element
Set Method:
__setName(self, newName) - Set the value of the 'name' attribute of represented XML element.
Type:
str

id

The 'id' attribute of represented XML element.

Get Method:
__getGID(self) - Returns: value of the 'id' attribute of represented XML element
Set Method:
__setGID(self, newID) - Set value of the 'id' attribute of represented XML element.
Type:
int

fill

The 'fill' attribute of represented XML element.

Get Method:
__getFill(self) - Returns: value of the 'fill' attribute of represented XML element
Set Method:
__setFill(self, newFill) - Set value of the 'fill' attribute of represented XML element.
Type:
str

fullname

The 'fullname' attribute of represented XML element.

Get Method:
__getFullname(self) - Returns: value of the 'fullname' attribute of represented XML element
Set Method:
__setFullname(self, newFullName) - Set value of the 'fullname' attribute of represented XML element.
Type:
str

uid

The 'uid' attribute of represented XML element.

Read-only property if a barIndexerStructureElement object is assigned to the object.

Get Method:
__getUID(self) - Returns: value of the 'uid' attribute of represented XML element
Set Method:
__setUID(self, newUID) - Set value of the 'uid' attribute of represented XML element.
Type:
int

uidList

List of 'uid' attributes of 'structure' elements assigned to the represented element.

Read-only property.

Get Method:
__getUidList(self) - Return list of 'uid' attributes of 'structure' elements assigned to the represented element.
Set Method:
__setUidList(self, newValues) - Raise ValueError.
Type:
[int, ...]

structure

Object representing 'structure' element related to the represented element.

Get Method:
__getStructure(self) - Returns: object representing the 'structure' element related to represented element
Set Method:
__setStructure(self, newStructure) - Assign _structure an object representing the 'structure' element related to represented element.
Type:
barIndexerStructureElement