Class TreasureTreeNode

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

    public class TreasureTreeNode
    extends javax.swing.tree.DefaultMutableTreeNode
    Subclass: Nodes in the CFTreasureListTree. Each node contains a TreasureObj as content.
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class javax.swing.tree.DefaultMutableTreeNode

        allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
    • Constructor Summary

      Constructors 
      Constructor Description
      TreasureTreeNode​(@NotNull TreasureObj content)
      Construct tree node with specified content object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull javax.swing.tree.MutableTreeNode getClone​(boolean processSecondLinking, @Nullable java.util.List<TreasureTreeNode> needSecondLink)
      Return a new cloned instance of this object.
      @NotNull TreasureObj getTreasureObj()  
      void recalculateChances()
      Recalculate the chances of objects in a treasureone list.
      @NotNull java.lang.String toString()  
      • Methods inherited from class javax.swing.tree.DefaultMutableTreeNode

        add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TreasureTreeNode

        public TreasureTreeNode​(@NotNull
                                @NotNull TreasureObj content)
        Construct tree node with specified content object.
        Parameters:
        content - the treasure object of this node
    • Method Detail

      • getClone

        @NotNull
        public @NotNull javax.swing.tree.MutableTreeNode getClone​(boolean processSecondLinking,
                                                                  @Nullable
                                                                  @Nullable java.util.List<TreasureTreeNode> needSecondLink)
        Return a new cloned instance of this object.
        Returns:
        a new cloned instance of this object
      • toString

        @NotNull
        public @NotNull java.lang.String toString()
        Overrides:
        toString in class javax.swing.tree.DefaultMutableTreeNode
        No Inspection:
        RefusedBequest
      • getTreasureObj

        @NotNull
        public @NotNull TreasureObj getTreasureObj()
      • recalculateChances

        public void recalculateChances()
        Recalculate the chances of objects in a treasureone list. The new chances always sum up to 100% total.