COItemGraph class documentation

COItemGraph : NSObject <COItemGraph>

An item graph is a mutable set of COItem objects, and a root item UUID, which is the designated entry point to the object graph.

AuthorsGenerated by qmathe
Declared inCOItemGraph.h


COItemGraph is allowed to contain broken references (i.e. it can contain COItems which have ETUUID references to items not in the COItemGraph, or even be missing the COItem for the root item UUID) - this is to allow COItemGraph to act as a simple delta mechanism, so you can compute (COItemGraph + COItemGraph) = a new COItemGraph .


+ (COItemGraph *) itemGraphWithItemsRootFirst: (NSArray *)items
Description forthcoming.
    - (id) initWithItemForUUID: (NSDictionary *)itemForUUID rootItemUUID: (ETUUID *)root

    N.B. items doesn't need to contain rootItemUUID.

      - (id) initWithItems: (NSArray *)items rootItemUUID: (ETUUID *)root

      N.B. items doesn't need to contain rootItemUUID.

        - (id) initWithItemGraph: (id <COItemGraph>)aGraph
        Description forthcoming.

          Item Graph Protocol and Additionss

          - (ETUUID *) rootItemUUID
          - (void) setRootItemUUID: (ETUUID *)rootItemUUID

          See -[COItemGraph rootItemUUID] .

            - (COMutableItem *) itemForUUID: (ETUUID *)aUUID
            - (NSArray *) itemUUIDs
            - (NSArray *) items

            Returns all the items in the graph.

            The returned item count is the same than -itemUUIDs .

              - (void) insertOrUpdateItems: (NSArray *)items
              - (void) addItemGraph: (id <COItemGraph>)aGraph

              Adds the items from the given item graph to the receiver.

              If two items have the same UUID, the added item replaces the one in the receiver.