Class NodeComparators

java.lang.Object
dev.metaschema.core.metapath.item.node.NodeComparators

public final class NodeComparators extends Object
Provides methods for comparing nodes according to the Metapath specification.
  • Method Details

    • compareNodeItem

      public static boolean compareNodeItem(@NonNull INodeItem item1, @NonNull INodeItem item2, @NonNull DynamicContext dynamicContext)
      Compare two node items for equality.
      Parameters:
      item1 - the first item to compare
      item2 - the second item to compare
      dynamicContext - used to provide evaluation information, including the implicit timezone
      Returns:
      true if both node items are the same type and have the same flag and model members, or false otherwise
    • compareModelNodeItem

      public static boolean compareModelNodeItem(@NonNull IModelNodeItem<?,?> item1, @NonNull IModelNodeItem<?,?> item2, @NonNull DynamicContext dynamicContext)
      Compare two node items for equality.
      Parameters:
      item1 - the first item to compare
      item2 - the second item to compare
      dynamicContext - used to provide evaluation information, including the implicit timezone
      Returns:
      a negative integer, zero, or a positive integer if the first argument is less than, equal to, or greater than the second.
    • compareAsFlag

      public static boolean compareAsFlag(@NonNull IFlagNodeItem item1, @NonNull IFlagNodeItem item2, @NonNull DynamicContext dynamicContext)
      Compare two flag node items for equality.
      Parameters:
      item1 - the first item to compare
      item2 - the second item to compare
      dynamicContext - used to provide evaluation information, including the implicit timezone
      Returns:
      true if both flags have the same name and value, or false otherwise