Class TreeStatePtr


  • public class TreeStatePtr
    extends java.lang.Object
    Ptr stores a pointer and optionally takes ownership of the value.
    • Constructor Detail

      • TreeStatePtr

        public TreeStatePtr​(long cPtr,
                            boolean cMemoryOwn)
      • TreeStatePtr

        public TreeStatePtr()
        Default constructor yielding a NULL-pointer.
      • TreeStatePtr

        public TreeStatePtr​(TreeState ptr)
        Do not take ownership of ptr.

        ptr can be null.

        The constructor is implicit on purpose.
    • Method Detail

      • getCPtr

        public static long getCPtr​(TreeStatePtr obj)
      • delete

        public void delete()
      • deref

        public TreeState deref()
        The pointer stored in the object.
      • __ref__

        public TreeState __ref__()
        Dereferencing operator.
      • getDeref

        public TreeState getDeref()
        Member access operator.
      • equals

        public boolean equals​(TreeState p)
      • isShared

        public boolean isShared()
        check if this Ptr has shared ownership or none
        ownership
        Returns:
        true if Ptr has shared ownership, false if it has no ownership.
      • isNull

        public boolean isNull()
        checks if the pointer is null
        Returns:
        Returns true if the pointer is null
      • getParent

        public Frame getParent​(FrameCPtr frame)
        The parent frame of frame.

        If the frame has no parent, then NULL is returned.

        (We should query the modifiable part of the tree here, but that is
        not implemented yet.)

        Parameters:
        frame - [in] The frame for which to retrieve the parent.

        Returns:
        The parent of the frame or NULL if the frame has no parent.
      • getChildren

        public FrameVector getChildren​(FrameCPtr frame)
        The child frames of frame.

        (We should query the modifiable part of the tree here, but that is
        not implemented yet.)

        Note that we break const-correctness. We treat TreeState as an
        implementation detail upon which an iterator interface in Frame is
        then built.

        Parameters:
        frame - [in] The frame for which to retrieve the children.

        Returns:
        The children of the frame if any children exist, else NULL.
      • attachFrame

        public void attachFrame​(FramePtr frame,
                                FramePtr parent)
        Move a frame within the tree.

        The frame frame is detached from its parent and reattached to
        parent. The frames frame and parent must both belong to the
        same tree.

        We may want to later restrict this method so that only frames of
        certain types can be moved.

        Parameters:
        frame - [in] The frame to move.
        parent - [in] The frame to attach frame to.
      • getStateSetup

        public StateSetupPtr getStateSetup()
        gets the StateSetup used to create the TreeState
        Returns:
        the StateSetup