Class MTreeUtils
java.lang.Object
kieker.analysis.generic.clustering.mtree.utils.MTreeUtils
public final class MTreeUtils
extends java.lang.Object
Some utilities.
- Since:
- 2.0.0
- Author:
- Eduardo R. D'Avila
-
Method Summary
Modifier and Type Method Description static <T extends java.lang.Comparable<T>>
Pair<T>minMax(java.lang.Iterable<T> items)
Identifies the minimum and maximum elements from an iterable, according to the natural ordering of the elements.static <T> java.util.List<T>
randomSample(java.util.Collection<T> collection, int numberOfElements)
Randomly chooses elements from the collection.
-
Method Details
-
minMax
Identifies the minimum and maximum elements from an iterable, according to the natural ordering of the elements.- Type Parameters:
T
- The type of the elements.- Parameters:
items
- AnIterable
object with the elements- Returns:
- A pair with the minimum and maximum elements.
-
randomSample
public static <T> java.util.List<T> randomSample(java.util.Collection<T> collection, int numberOfElements)Randomly chooses elements from the collection.- Type Parameters:
T
- The type of the elements.- Parameters:
collection
- The collection.numberOfElements
- The number of elements to choose.- Returns:
- A list with the chosen elements.
-