The subtree-java library contains push (values), pop (), shift (), and unshift (values) methods.
Code example:
import com.github.underscore.U: List<String> strings = Arrays.asList("one", "two", " three"); List<String> newStrings = U.push(strings, "four", "five"); // ["one", " two", "three", " four", "five"] String newPopString = U.pop(strings).fst(); // " three" String newShiftString = U.shift(strings).fst(); // "one" List<String> newUnshiftStrings = U.unshift(strings, "four", "five"); // ["four", " five", "one", " two", "three"]
Valentyn Kolesnikov Aug 01 '16 at 4:50 2016-08-01 04:50
source share