First page Back Continue Last page Overview Graphics
Entity
class Entity( object ):
"""An entity, used to characterize a fact."""
def __init__( self, *levelsTuple ):
self.dimension= None
self.level= tuple( map( str, levelsTuple ) )
self.facts= []
def append( self, aFact ):
"""Associate facts with their respective entities."""
self.facts.append( aFact )
def __str__ ( self ):
return ":".join( self.level )
def __repr__( self ):
return "%s%r" % ( self.__class__.__name__, self.level )
def __cmp__( self, other ):
return cmp( self.level, other.level )