@OpenApiAll
public class ScriptHelper
extends java.lang.Object
Constructor and Description |
---|
ScriptHelper() |
Modifier and Type | Method and Description |
---|---|
static double |
calcAverageForList(java.util.List<? extends java.lang.Number> items)
Calculates average for a list of numbers.
|
static double |
calcPercentage(int all,
int covered)
Calculates percentage.
|
static java.util.Collection |
getElementsRecursively(java.util.Collection<? extends Element> owningPackages)
Returns all elements in given packages recursively.
|
static java.util.Collection |
getElementsRecursively(Element owningPackage)
Returns all elements in a package recursively.
|
static boolean |
isParentOf(BaseElement possibleParent,
BaseElement possibleChild)
Checks if given object is child of given parent object.
|
static boolean |
isParentOf(java.util.Collection<? extends BaseElement> possibleParents,
BaseElement possibleChild)
Checks if given object is child of any element in a given list of possible parents.
|
public static java.util.Collection getElementsRecursively(Element owningPackage)
owningPackage
- package to collect the elementspublic static java.util.Collection getElementsRecursively(java.util.Collection<? extends Element> owningPackages)
owningPackages
- collection of packages to collect the elementspublic static boolean isParentOf(BaseElement possibleParent, BaseElement possibleChild)
possibleParent
- possible parentpossibleChild
- possible childpublic static boolean isParentOf(java.util.Collection<? extends BaseElement> possibleParents, BaseElement possibleChild)
possibleParents
- possible parentpossibleChild
- possible childpublic static double calcPercentage(int all, int covered)
all
- denominatorcovered
- nominatorpublic static double calcAverageForList(@CheckForNull java.util.List<? extends java.lang.Number> items)
items
- list of numbers