Beispiel #1
0
    def get_child(self) -> Entry:
        r"""Get the child entry of the link.

        Returns:
             An instance of :class:`Entry` that is the child of the link.
        """
        if self._child is None:
            raise IncompleteEntryError("The parent of this link is not set.")

        pack_idx, child_tid = self._child
        return self.pack.get_subentry(pack_idx, child_tid)
Beispiel #2
0
    def get_parent(self) -> SubEntry:
        r"""Get the parent entry of the link.

        Returns:
             An instance of :class:`SubEntry` that is the parent of the link
             from the given DataPack.
        """
        if self._parent is None:
            raise IncompleteEntryError("The parent of this link is not set.")
        pack_idx, parent_tid = self._parent

        return SubEntry(self.pack, pack_idx, parent_tid)
Beispiel #3
0
 def child(self) -> Tuple[int, int]:
     if self._child is None:
         raise IncompleteEntryError("Child is not set for this link.")
     return self._child
Beispiel #4
0
 def parent(self) -> Tuple[int, int]:
     if self._parent is None:
         raise IncompleteEntryError("Parent is not set for this link.")
     return self._parent