Class TraverseHelper

java.lang.Object
introspector.model.traverse.TraverseHelper

public class TraverseHelper extends Object
MapNode provides a Node implementation to represent any value whose type is a java.util.Map.
  • Constructor Details

    • TraverseHelper

      public TraverseHelper()
  • Method Details

    • containsNullKey

      public static boolean containsNullKey(Map<?,?> map)
      Returns whether the map contains a null key.
    • couldBeVisitedTwice

      static boolean couldBeVisitedTwice(Node node)
      Returns whether a node could be visited twice or more
      Parameters:
      node - the node traversed
      Returns:
      whether the node could be visited twice or more
    • couldBeVisitedTwice

      static boolean couldBeVisitedTwice(SymmetricPair<Node,Node> nodePair)
      Returns whether two nodes could be visited twice or more
      Parameters:
      nodePair - the node traversed
      Returns:
      whether the node could be visited twice or more
    • hasBeenVisited

      static boolean hasBeenVisited(Node node, Set<Node> alreadyTraversed)
      Returns whether a node is a cyclic or alias reference. That is, it has been already traversed and hence the tree is actually a graph.
      Parameters:
      node - the node traversed
      alreadyTraversed - a set of previously traversed nodes
      Returns:
      whether the node is a cyclic or alias reference
    • hasBeenVisited

      static boolean hasBeenVisited(SymmetricPair<Node,Node> nodePair, Set<SymmetricPair<Node,Node>> alreadyTraversed)
      Returns whether a pair of nodes have a cyclic or alias reference. That is, it has been already traversed and hence the tree is actually a graph.
      Parameters:
      nodePair - the node traversed
      alreadyTraversed - a set of previously traversed nodes
      Returns:
      whether the node is a cyclic or alias reference
    • shouldBeTraversed

      public static boolean shouldBeTraversed(Node node, Set<Node> alreadyTraversed)
      Returns whether a node should be traversed. That is, it has not been traversed yet.
      Parameters:
      node - the node traversed
      alreadyTraversed - a set of previously traversed nodes
      Returns:
      whether the node should be traversed
    • shouldBeTraversed

      public static boolean shouldBeTraversed(SymmetricPair<Node,Node> nodePair, Set<SymmetricPair<Node,Node>> alreadyTraversed)
      Returns whether two nodes in a comparison (two trees) should be traversed. That is, it has not been traversed yet as a pair
      Parameters:
      nodePair - the pair of nodes traversed
      alreadyTraversed - a set of previously traversed nodes
      Returns:
      whether the node should be traversed
    • addNewChildren

      public static void addNewChildren(List<Node> children1, List<Node> children2, Set<Node> modifiedNodes)
      Adds the new children to the modified nodes.
      Parameters:
      children1 - One list of nodes
      children2 - Another list of nodes
      modifiedNodes - The set of modified nodes where the new children will be added