Java Utililty Methods SortedSet Usage

List of utility methods to do SortedSet Usage

  1. HOME
  2. Java
  3. S
  4. SortedSet Usage

Description

The list of methods to do SortedSet Usage are organized into topic(s).

Method

String concatStringList(SortedSet sortedDependencies)
Concatenates a SortedSet of Strings with a semicolon between them.
String concatenatedString = "";
for (String s : sortedDependencies) {
 concatenatedString = concatenatedString.concat(s + ";");
return concatenatedString;
T findLT(SortedSet ss, T x)
Finds the largest value that is smaller than x in a SortedSet
SortedSet<T> p = ss.headSet(x);
return p.isEmpty() ? null : p.last();
int findPositionFor(final T item, final SortedSet values)
find Position For
final SortedSet<T> head = values.headSet(item);
return head.size();
T firstOrNull(SortedSet set)
first Or Null
if (set == null || set.isEmpty()) {
 return null;
return set.first();
int nextValue(SortedSet valueSet, int startValue)
next Value
if (valueSet == null) {
 return startValue;
if (valueSet.contains(startValue)) {
 return startValue;
SortedSet<Integer> tailSet = valueSet.tailSet(startValue + 1);
if (tailSet.isEmpty()) {
...
boolean sortedSetIsAssignableFrom(Class aClass)
Determines if the SortedSet interface is either the same as, or is a superinterface of, the class or interface represented by the specified Class parameter.
return SortedSet.class.isAssignableFrom(aClass);
SortedSet sortedSetOf(final Object obj, final Class castTo)
sorted Set Of
return (SortedSet<T>) obj;
double[] toDoubleArray(final int[] intArray)
to Double Array
final int length = intArray.length;
final double[] doubleArray = new double[length];
for (int i = 0; i < intArray.length; i++) {
 doubleArray[i] = intArray[i];
return doubleArray;


AltStyle によって変換されたページ (->オリジナル) /