Package overit.geocall.util
Class LongSet
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Long>,Collection<Long>,Iterator,NavigableSet<Long>,SequencedCollection<Long>,SequencedSet<Long>,Set<Long>,SortedSet<Long>
This class extends
TreeSet and implements a navigable set of Long elements.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLongSet()Creates a new empty LongSet, sorted according to the natural ordering of its elements.Creates a new LongSet and fills it with the Long values passed as parameters.Creates a new LongSet starting from the values contained in the string.Creates a new LongSet starting from the values contained in the string.LongSet(Collection<Long> c) Creates a new LongSet and fills it with all the elements of theCollectionpassed as parameter; the elements in the collection must be of type Long.LongSet(Comparator<Long> c) -
Method Summary
Modifier and TypeMethodDescriptionstatic LongSetcreateLongSet(DBView dbv, String field) Deprecated.booleanhasNext()Checks if the intervals Iterator (seeintervalsIterator()) has a next elementsReturns an Iterator over the intervals (ranges) defined for the LongSetnext()Returns the next element of the intervals Iterator (seeintervalsIterator())voidremove()Empty methodprotected voidscanNext()Returns a string version of the LongSet in which the values are expressed in range form.toIntervalsString(char delim, char rangedelim) Returns a string version of the LongSet in which the values are expressed in range form.toString()Returns the string version of the LongSet, i.e. a string in which every value is separated from the next by the comma (,) character.toString(char delim) Returns the string version of the LongSet, i.e. a string in which every value is separated from the next by the delimiter character passed as parameterMethods inherited from class java.util.TreeSet
add, addAll, addFirst, addLast, ceiling, clear, clone, comparator, contains, descendingIterator, descendingSet, first, floor, headSet, headSet, higher, isEmpty, iterator, last, lower, pollFirst, pollLast, remove, size, spliterator, subSet, subSet, tailSet, tailSetMethods inherited from class java.util.AbstractSet
equals, hashCode, removeAllMethods inherited from class java.util.AbstractCollection
containsAll, retainAll, toArray, toArrayMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Iterator
forEachRemainingMethods inherited from interface java.util.NavigableSet
removeFirst, removeLast, reversed
-
Constructor Details
-
LongSet
-
LongSet
Creates a new LongSet and fills it with the Long values passed as parameters. The LongSet is sorted according to the natural ordering of its elements.- Parameters:
ll- A variable number of Long values that will fill the LongSet
-
LongSet
Creates a new LongSet and fills it with all the elements of theCollectionpassed as parameter; the elements in the collection must be of type Long. The LongSet is sorted according to the natural ordering of its elements.- Parameters:
c- The Collection of Long values that will fill the LongSet
-
LongSet
public LongSet()Creates a new empty LongSet, sorted according to the natural ordering of its elements. -
LongSet
Creates a new LongSet starting from the values contained in the string. Each value must be separated from the next by the comma (,). It is possible to indicate ranges of values by separating the start and end of the range using the minus character (-); the values between the beginning and the end of the range will all be included in the LongSet.
The LongSet is sorted according to the natural ordering of its elements.- Parameters:
s- The string that contains the values that will fill the LongSet
-
LongSet
Creates a new LongSet starting from the values contained in the string. Each value must be separated from the next by the delimiter character passed as second parameter. It is possible to indicate ranges of values by separating the start and end of the range using the range delimiter character passed as last parameter; the values between the beginning and the end of the range will all be included in the LongSet.
The LongSet is sorted according to the natural ordering of its elements.- Parameters:
s- The string that contains the values that will fill the LongSetdelim- The character that defines the values separatorrangedelim- The character that defines the range separator
-
-
Method Details
-
toString
Returns the string version of the LongSet, i.e. a string in which every value is separated from the next by the comma (,) character.- Overrides:
toStringin classAbstractCollection<Long>- Returns:
- The string that represents the LongSet
-
toString
Returns the string version of the LongSet, i.e. a string in which every value is separated from the next by the delimiter character passed as parameter- Parameters:
delim- The character used to separate each value- Returns:
- The string that represents the LongSet
-
scanNext
protected void scanNext() -
intervalsIterator
Returns an Iterator over the intervals (ranges) defined for the LongSet- Returns:
- The Iterator in which every element is a values interval
-
hasNext
public boolean hasNext()Checks if the intervals Iterator (seeintervalsIterator()) has a next elements -
next
Returns the next element of the intervals Iterator (seeintervalsIterator()) -
remove
public void remove()Empty method -
toIntervalsString
Returns a string version of the LongSet in which the values are expressed in range form. Each range is indicated by the initial and the final value, separated by the minus sign (-), and each range is separated by the next one with the comma (,).- Returns:
- The string that represents the range version of the LongSet values
-
toIntervalsString
Returns a string version of the LongSet in which the values are expressed in range form. Each range is indicated by the initial and the final value, separated by the range delimiter character passed as second parameter. Each range is separated by the next one with the delimiter character, passed es first parameter.- Parameters:
delim- The character used to separate each rangerangedelim- The character that defines the range separator- Returns:
- The string that represents the range version of the LongSet values
-
createLongSet
Deprecated.UseDBView.getLongSet(java.lang.String)
Creates a LongSet and fills it with the values extracted from the column of theDBView- Parameters:
dbv- The DBView from which extract the valuesfield- The column name- Returns:
- A new LongSet filled with the extracted values
-
DBView.getLongSet(java.lang.String)Creates a LongSet and fills it with the values extracted from the column of the
DBView