Module org.jpo

Class RandomNavigator

java.lang.Object
org.jpo.datamodel.NodeNavigator
org.jpo.datamodel.RandomNavigator
All Implemented Interfaces:
NodeNavigatorInterface

public class RandomNavigator extends NodeNavigator
This class returns a NodeNavigator which shuffles the supplied nodes
  • Constructor Details

    • RandomNavigator

      public RandomNavigator(List<SortableDefaultMutableTreeNode> nodes, String title)
      Constructor for a RandomNavigator.
      Parameters:
      nodes - A List of nodes to randomly navigate
      title - The title of the nodes
  • Method Details

    • getTitle

      public String getTitle()
      returns a title for this NodeNavigator
      Returns:
      the Title for the NodeNavigator
    • getNumberOfNodes

      public int getNumberOfNodes()
      Returns the number of nodes in the shuffled list
      Returns:
      The number of nodes in the list
    • getNode

      public SortableDefaultMutableTreeNode getNode(int index)
      Returns the node for the specific index
      Parameters:
      index - The index of the node to retrieve
      Returns:
      the node for the index number