List of utility methods to do TreeSet
Set | getTreeSet(final Object o, final Class Cast an object into a typed TreeSet . final Set<T> set = new TreeSet<>(); set(set, o, classElement); return set; |
double | getVariance(TreeSet get Variance double average = 0; int last = 0; for (Integer position : positions) { average += position - last; last = position; average = average / positions.size() - 1; double var = 0; ... |
TreeSet | intersection(TreeSet intersection TreeSet<String> returnTreeSet = new TreeSet<String>(); for (String test : AL1) { if (!returnTreeSet.contains(test)) { if (AL2.contains(test)) { returnTreeSet.add(test); return returnTreeSet; |
double | minDiff(TreeSet min Diff double lowestYet = Double.MAX_VALUE; double last = -Double.MAX_VALUE; for (Double d : numbers) { double diff = d - last; if (diff < lowestYet) lowestYet = diff; last = d; return lowestYet; |
TreeSet | newTreeSet(final Collection extends E> c) new Tree Set return new TreeSet<E>(c); |
TreeSet | toTreeSet(Collection to Tree Set TreeSet<String> tree = new TreeSet<String>(); for (String em : lines) { tree.add(em); return tree; |
TreeSet | toTreeSet(Collection to Tree Set final TreeSet<T> treeSet = new TreeSet<T>(comparator); for (T t : collection) { treeSet.add(t); return treeSet; |
Set | treeSet(E... add) tree Set Set<E> result = new TreeSet<>(); if (add != null) { result.addAll(Arrays.asList(add)); return result; |
Set | treeSet(final Collection Tree set. final Set<T> list = new TreeSet<T>(); if (collection != null && collection.size() > 0) list.addAll(collection); return list; |
TreeSet | treeSet(final T item) tree Set final TreeSet<T> treeSet = new TreeSet<>(); if (null != item) { treeSet.add(item); return treeSet; |