public final class PrimitiveUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PrimitiveUtils.PathCounter
The PathCounter class helps count the number of possible paths from a source (parent) primitive
to a target (child) primitive.
|
Modifier and Type | Method and Description |
---|---|
static int |
countNonJunctionParents(Primitive primitive)
Counts non-junction parents of the given primitive.
|
static int |
getChildCount(PrimitiveAnd root,
Primitive.Kind kind)
Counts the number of childs (arguments) that have a specific type for the given primitive.
|
static boolean |
isJunction(Primitive primitive)
Checks whether the given primitive is a junction.
|
static boolean |
isLeaf(Primitive primitive)
Checks whether the given primitive is a leaf primitive.
|
static void |
saveAllOrsToList(Primitive source,
java.util.List<PrimitiveAnd> destination)
Saves all AND primitives associated with the current primitive by using OR rules to a list.
|
public static void saveAllOrsToList(Primitive source, java.util.List<PrimitiveAnd> destination)
source
- A primitives that serves as a source.destination
- The list to which AND rules are to be saved.java.lang.NullPointerException
- if any of the parameters equals null.public static int getChildCount(PrimitiveAnd root, Primitive.Kind kind)
root
- Root primitive.kind
- Type of child primitives to be counted.java.lang.NullPointerException
- if any of the parameters equals null.public static boolean isLeaf(Primitive primitive)
primitive
- Primitive to be checked.java.lang.NullPointerException
- if the parameter equals null.public static boolean isJunction(Primitive primitive)
primitive
- Primitive to be checked.java.lang.NullPointerException
- if the parameter equals null.public static int countNonJunctionParents(Primitive primitive)
primitive
- Primitive to be checked.java.lang.NullPointerException
- if the parameter equals null.