本文整理了Java中org.eclipse.collections.impl.block.factory.Functions.firstOfPair()
方法的一些代码示例,展示了Functions.firstOfPair()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Functions.firstOfPair()
方法的具体详情如下:
包路径:org.eclipse.collections.impl.block.factory.Functions
类名称:Functions
方法名:firstOfPair
暂无
代码示例来源:origin: eclipse/eclipse-collections
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()));
}
代码示例来源:origin: eclipse/eclipse-collections
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()));
}
代码示例来源:origin: eclipse/eclipse-collections
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()));
}
代码示例来源:origin: eclipse/eclipse-collections
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()));
}
代码示例来源:origin: eclipse/eclipse-collections
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()));
}
代码示例来源:origin: eclipse/eclipse-collections
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()));
}
代码示例来源:origin: eclipse/eclipse-collections
@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;
}
代码示例来源:origin: eclipse/eclipse-collections
@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;
}
代码示例来源:origin: eclipse/eclipse-collections
@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;
}
代码示例来源:origin: eclipse/eclipse-collections
@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;
}
代码示例来源:origin: eclipse/eclipse-collections
@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)));
}
代码示例来源:origin: eclipse/eclipse-collections
@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)));
}
代码示例来源:origin: eclipse/eclipse-collections
@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)));
}
代码示例来源:origin: eclipse/eclipse-collections
@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)));
}
代码示例来源:origin: eclipse/eclipse-collections
@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();
}
代码示例来源:origin: eclipse/eclipse-collections
@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();
}
代码示例来源:origin: eclipse/eclipse-collections
@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();
}
代码示例来源:origin: eclipse/eclipse-collections
@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();
}
代码示例来源:origin: org.eclipse.collections/eclipse-collections
@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)));
}
代码示例来源:origin: org.eclipse.collections/eclipse-collections
@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)));
}
内容来源于网络,如有侵权,请联系作者删除!