Class InheritanceGraph

java.lang.Object
me.lucko.luckperms.common.inheritance.InheritanceGraph
All Implemented Interfaces:
Graph<PermissionHolder>

public class InheritanceGraph extends Object implements Graph<PermissionHolder>
A Graph which represents an "inheritance tree".
  • Constructor Details

    • InheritanceGraph

      public InheritanceGraph(LuckPermsPlugin plugin, net.luckperms.api.query.QueryOptions queryOptions)
  • Method Details

    • successors

      public Iterable<? extends PermissionHolder> successors(PermissionHolder holder)
      Description copied from interface: Graph
      Returns all nodes in this graph directly adjacent to node which can be reached by traversing node's outgoing edges.
      Specified by:
      successors in interface Graph<PermissionHolder>
    • traverse

      public Iterable<PermissionHolder> traverse(TraversalAlgorithm algorithm, boolean postTraversalSort, PermissionHolder startNode)
      Returns an iterable which will traverse this inheritance graph using the specified algorithm starting at the given permission holder start node.
      Parameters:
      algorithm - the algorithm to use when traversing
      postTraversalSort - if a final sort according to inheritance (weight, primary group) rules should be performed after the traversal algorithm has completed
      startNode - the start node in the inheritance graph
      Returns:
      an iterable
    • traverse

      public Iterable<PermissionHolder> traverse(PermissionHolder startNode)
      Perform a traversal according to the rules defined in the configuration.
      Parameters:
      startNode - the start node in the inheritance graph
      Returns:
      an iterable