shift method
Shifts the order of the elements in this set by the provided amount
.
Note: This method should not be used on unordered sets, such as a HashSet.
Implementation
void shift(int amount) {
amount %= length;
if (amount > 0) {
addAll(pluck(0, length - amount));
} else if (amount < 0) {
addAll(pluck(0, amount.abs()));
}
}