The list of methods to do SortedSet are organized into topic(s).
SortedSet
asSortedSet(T... args)
as Sorted Set
SortedSet<T> result = new TreeSet<T>();
if (args != null) {
for (T arg : args) {
if (arg != null) {
result.add(arg);
return result;
SortedSet
asSortedSet(T... elements)
Converts the given array of elements to a sortedset.
SortedSet<T> result = new TreeSet<T>();
if (elements == null) {
return result;
result.addAll(asList(elements));
return result;
List
>> computeGraphCauselessFromGraphLmms( List>>> causesByDepByNameList)
Removes the causes.
final List<SortedMap<String, SortedSet<String>>> reduced = new ArrayList<SortedMap<String, SortedSet<String>>>();
for (SortedMap<String, SortedMap<String, SortedSet<String>>> causesByDepByName : causesByDepByNameList) {
final SortedMap<String, SortedSet<String>> withoutCausesMap = computeGraphCauselessFromGraphMms(
causesByDepByName);
reduced.add(withoutCausesMap);
return reduced;
SortedMap
> computeGraphCauselessFromGraphMms( SortedMap>> causesByDepByName)
Removes the causes.
final SortedMap<String, SortedSet<String>> reduced = new TreeMap<String, SortedSet<String>>();
for (Map.Entry<String, SortedMap<String, SortedSet<String>>> entry : causesByDepByName.entrySet()) {
final String name = entry.getKey();
final SortedMap<String, SortedSet<String>> causesByDep = entry.getValue();
final SortedSet<String> deps = new TreeSet<String>(causesByDep.keySet());
final Object forCheck = reduced.put(name, deps);
if (forCheck != null) {
throw new AssertionError();
...
SortedSet
copyAndClearSet(SortedSet sourceSet)
Copy items from source to target set; then clear source set and set it to null
TreeSet<String> newSet = null;
if (sourceSet != null) {
newSet = new TreeSet<String>();
Iterator<String> iter = sourceSet.iterator();
while (iter.hasNext()) {
String oldKey = iter.next();
String key = new String(oldKey);
newSet.add(key);
...
SortedSet
doubleForDescreteStartAndEnds(SortedSet hours) Do a doubling that creates a set of times where start and end times become distinct even/odd entities in the set.
TreeSet retval = new TreeSet();
if (hours.isEmpty()) {
return (retval);
Iterator vit = hours.iterator();
while (vit.hasNext()) {
Integer time = (Integer) vit.next();
int start = time.intValue() * 2;
...
SortedSet
SortedSet<Map.Entry<K, V>> sortedEntries = new TreeSet<Map.Entry<K, V>>(new Comparator<Map.Entry<K, V>>() {
@Override
public int compare(Map.Entry<K, V> e1, Map.Entry<K, V> e2) {
return e1.getValue().compareTo(e2.getValue());
});
sortedEntries.addAll(map.entrySet());
return sortedEntries;
...
SortedSet
fillOutHourly(SortedSet hours) Fill the set of hours to be hourly
TreeSet retval = new TreeSet(hours);
if (hours.isEmpty() || (hours.size() == 1)) {
return (retval);
int minTime = ((Integer) hours.first()).intValue() + 1;
int maxTime = ((Integer) hours.last()).intValue() - 1;
for (int i = minTime; i <= maxTime; i++) {
retval.add(new Integer(i));
...