com.poiji.save.OrderedValues Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of poiji2 Show documentation
Show all versions of poiji2 Show documentation
Perfect annotation based library to read and write excel files
package com.poiji.save;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
public final class OrderedValues {
private final Collection busyOrders;
public OrderedValues(final Collection busyOrders) {
this.busyOrders = busyOrders;
}
public Map toOrder(final Collection unorderedValues) {
final Map ordered = new HashMap<>();
int order = 0;
for (final T name : unorderedValues) {
while (busyOrders.contains(order)) {
order++;
}
ordered.put(name, order++);
}
return ordered;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy