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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • minMax

      public 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.
      Type Parameters:
      T - The type of the elements.
      Parameters:
      items - An Iterable 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.