Next / Previous / Contents / Shipman's homepage

6.19. class UniGroup: A group of entity sets

An entity group is a collection of named entity sets and nothing more. Note that a given entity set name may occur in more than one entity group.

unidata.py
# - - - - -   c l a s s   U n i G r o u p

class UniGroup(object):
    '''Represents a group of entities.

      UniGroup(uniData, node):
        [ (uniData is the containing UniData instance) and
          (node is a GROUP_N et.Element) ->
            return a new UniGroup instance representing node ]
      .uniData:     [ as passed to constructor ]
      .name:        [ NAME_A attribute ]
      .genEntSets():
        [ generate the UniEntSets in self in ascending order by name ]
      .findEntSet(setName):
        [ setName is a str ->
            if setName names a UniEntSet set in self ->
              return that set as a UniEntSet
            else -> raise KeyError ]

An instance of this class is a container for instances of Section 6.24, “class UniEntSet: One entity set”.

unidata.py
      State/Invariants:
        ._setMap:
          [ a dictionary whose keys are the entity set names in self,
            and each related value is a UniEntSet representing the
            entity set with that name ]
    '''