public TreeSortedMap(Pair<K, V>... pairs) { this.treeMap = new TreeMap<>(); ArrayIterate.forEach(pairs, new MapCollectProcedure<Pair<K, V>, K, V>( this.treeMap, Functions.firstOfPair(), Functions.secondOfPair())); }
public UnifiedMap(Pair<K, V>... pairs) { this(Math.max(pairs.length, DEFAULT_INITIAL_CAPACITY), DEFAULT_LOAD_FACTOR); ArrayIterate.forEach(pairs, new MapCollectProcedure<Pair<K, V>, K, V>( this, Functions.firstOfPair(), Functions.secondOfPair())); }
public UnifiedMapWithHashingStrategy(HashingStrategy<? super K> hashingStrategy, Pair<K, V>... pairs) { this(hashingStrategy, Math.max(pairs.length, DEFAULT_INITIAL_CAPACITY), DEFAULT_LOAD_FACTOR); ArrayIterate.forEach(pairs, new MapCollectProcedure<Pair<K, V>, K, V>( this, Functions.firstOfPair(), Functions.secondOfPair())); }
public UnifiedMapWithHashingStrategy(HashingStrategy<? super K> hashingStrategy, Pair<K, V>... pairs) { this(hashingStrategy, Math.max(pairs.length, DEFAULT_INITIAL_CAPACITY), DEFAULT_LOAD_FACTOR); ArrayIterate.forEach(pairs, new MapCollectProcedure<Pair<K, V>, K, V>( this, Functions.firstOfPair(), Functions.secondOfPair())); }
public TreeSortedMap(Pair<K, V>... pairs) { this.treeMap = new TreeMap<>(); ArrayIterate.forEach(pairs, new MapCollectProcedure<Pair<K, V>, K, V>( this.treeMap, Functions.firstOfPair(), Functions.secondOfPair())); }
public UnifiedMap(Pair<K, V>... pairs) { this(Math.max(pairs.length, DEFAULT_INITIAL_CAPACITY), DEFAULT_LOAD_FACTOR); ArrayIterate.forEach(pairs, new MapCollectProcedure<Pair<K, V>, K, V>( this, Functions.firstOfPair(), Functions.secondOfPair())); }
@Override public MutableSortedMap<K, V> with(Pair<K, V>... pairs) { ArrayIterate.forEach(pairs, new MapCollectProcedure<Pair<K, V>, K, V>(this, Functions.firstOfPair(), Functions.secondOfPair())); return this; }
@Override public TreeSortedMap<K, V> with(Pair<K, V>... pairs) { ArrayIterate.forEach(pairs, new MapCollectProcedure<Pair<K, V>, K, V>(this, Functions.firstOfPair(), Functions.secondOfPair())); return this; }
@Override public MutableSortedMap<K, V> with(Pair<K, V>... pairs) { ArrayIterate.forEach(pairs, new MapCollectProcedure<Pair<K, V>, K, V>(this, Functions.firstOfPair(), Functions.secondOfPair())); return this; }
@Override public TreeSortedMap<K, V> with(Pair<K, V>... pairs) { ArrayIterate.forEach(pairs, new MapCollectProcedure<Pair<K, V>, K, V>(this, Functions.firstOfPair(), Functions.secondOfPair())); return this; }
@Override public TreeSortedSet<Pair<T, Integer>> zipWithIndex() { Comparator<? super T> comparator = this.comparator(); if (comparator == null) { TreeSortedSet<Pair<T, Integer>> pairs = TreeSortedSet.newSet(Comparators.byFunction(Functions.firstOfPair(), Comparators.naturalOrder())); return Iterate.zipWithIndex(this, pairs); } return Iterate.zipWithIndex(this, TreeSortedSet.newSet(Comparators.byFirstOfPair(comparator))); }
@Override public MutableSortedSet<Pair<T, Integer>> zipWithIndex() { Comparator<? super T> comparator = this.comparator(); if (comparator == null) { TreeSortedSet<Pair<T, Integer>> pairs = TreeSortedSet.newSet(Comparators.byFunction(Functions.firstOfPair(), Comparators.naturalOrder())); return Iterate.zipWithIndex(this.delegate, pairs); } return Iterate.zipWithIndex(this.delegate, TreeSortedSet.newSet(Comparators.byFirstOfPair(comparator))); }
@Override public TreeSortedSet<Pair<T, Integer>> zipWithIndex() { Comparator<? super T> comparator = this.comparator(); if (comparator == null) { TreeSortedSet<Pair<T, Integer>> pairs = TreeSortedSet.newSet(Comparators.byFunction(Functions.firstOfPair(), Comparators.naturalOrder())); return Iterate.zipWithIndex(this, pairs); } return Iterate.zipWithIndex(this, TreeSortedSet.newSet(Comparators.byFirstOfPair(comparator))); }
@Override public MutableSortedSet<Pair<T, Integer>> zipWithIndex() { Comparator<? super T> comparator = this.comparator(); if (comparator == null) { TreeSortedSet<Pair<T, Integer>> pairs = TreeSortedSet.newSet(Comparators.byFunction(Functions.firstOfPair(), Comparators.naturalOrder())); return Iterate.zipWithIndex(this.delegate, pairs); } return Iterate.zipWithIndex(this.delegate, TreeSortedSet.newSet(Comparators.byFirstOfPair(comparator))); }
@Override public ImmutableSortedSet<Pair<T, Integer>> zipWithIndex() { Comparator<? super T> comparator = this.comparator() == null ? Comparators.naturalOrder() : this.comparator(); TreeSortedSet<Pair<T, Integer>> pairs = TreeSortedSet.newSet( Comparators.<Pair<T, Integer>>chain( Comparators.byFunction(Functions.firstOfPair(), comparator), Comparators.byFunction(Functions.secondOfPair()))); return Iterate.zipWithIndex(this, pairs).toImmutable(); }
@Override public ImmutableSortedSet<Pair<T, Integer>> zipWithIndex() { Comparator<? super T> comparator = this.comparator(); if (comparator == null) { TreeSortedSet<Pair<T, Integer>> pairs = TreeSortedSet.newSet(Comparators.byFunction(Functions.firstOfPair(), Comparators.naturalOrder())); return Iterate.zipWithIndex(this, pairs).toImmutable(); } return Iterate.zipWithIndex(this, TreeSortedSet.newSet(Comparators.byFirstOfPair(comparator))).toImmutable(); }
@Override public ImmutableSortedSet<Pair<T, Integer>> zipWithIndex() { Comparator<? super T> comparator = this.comparator() == null ? Comparators.naturalOrder() : this.comparator(); TreeSortedSet<Pair<T, Integer>> pairs = TreeSortedSet.newSet( Comparators.<Pair<T, Integer>>chain( Comparators.byFunction(Functions.firstOfPair(), comparator), Comparators.byFunction(Functions.secondOfPair()))); return Iterate.zipWithIndex(this, pairs).toImmutable(); }
@Override public ImmutableSortedSet<Pair<T, Integer>> zipWithIndex() { Comparator<? super T> comparator = this.comparator(); if (comparator == null) { TreeSortedSet<Pair<T, Integer>> pairs = TreeSortedSet.newSet(Comparators.byFunction(Functions.firstOfPair(), Comparators.naturalOrder())); return Iterate.zipWithIndex(this, pairs).toImmutable(); } return Iterate.zipWithIndex(this, TreeSortedSet.newSet(Comparators.byFirstOfPair(comparator))).toImmutable(); }
@Override public MutableSortedSet<Pair<T, Integer>> zipWithIndex() { Comparator<? super T> comparator = this.comparator(); if (comparator == null) { TreeSortedSet<Pair<T, Integer>> pairs = TreeSortedSet.newSet(Comparators.byFunction(Functions.firstOfPair(), Comparators.naturalOrder())); return Iterate.zipWithIndex(this.delegate, pairs); } return Iterate.zipWithIndex(this.delegate, TreeSortedSet.newSet(Comparators.byFirstOfPair(comparator))); }
@Override public TreeSortedSet<Pair<T, Integer>> zipWithIndex() { Comparator<? super T> comparator = this.comparator(); if (comparator == null) { TreeSortedSet<Pair<T, Integer>> pairs = TreeSortedSet.newSet(Comparators.byFunction(Functions.firstOfPair(), Comparators.naturalOrder())); return Iterate.zipWithIndex(this, pairs); } return Iterate.zipWithIndex(this, TreeSortedSet.newSet(Comparators.byFirstOfPair(comparator))); }