本文整理了Java中org.eclipse.collections.impl.block.factory.Functions.secondOfPair()
方法的一些代码示例,展示了Functions.secondOfPair()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Functions.secondOfPair()
方法的具体详情如下:
包路径:org.eclipse.collections.impl.block.factory.Functions
类名称: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
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 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() == 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: org.eclipse.collections/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: org.eclipse.collections/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: org.eclipse.collections/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: org.eclipse.collections/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: org.eclipse.collections/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: org.eclipse.collections/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: goldmansachs/obevo
@Test
public void testStringParsing() {
ObjectTypeAndNamePredicateBuilder parse = ObjectTypeAndNamePredicateBuilder.parse("TABLE~tab1,tab2;-VIEW~view1", null);
Predicates<? super Pair<String, String>> predicate = parse.build(Functions.<String>firstOfPair(), (Function<Pair<String, String>, String>) (Function) Functions.<String>secondOfPair());
assertTrue(predicate.accept(Tuples.pair("OTHER", "otherInclude")));
assertTrue(predicate.accept(Tuples.pair("TABLE", "tab1")));
assertTrue(predicate.accept(Tuples.pair("TABLE", "tab2")));
assertFalse(predicate.accept(Tuples.pair("TABLE", "tabNo")));
assertFalse(predicate.accept(Tuples.pair("VIEW", "view1")));
assertTrue(predicate.accept(Tuples.pair("VIEW", "viewInclude")));
}
代码示例来源:origin: goldmansachs/obevo
@Test
public void testStringParsingWithExclusionDefault() {
ObjectTypeAndNamePredicateBuilder parse = ObjectTypeAndNamePredicateBuilder.parse("TABLE~tab1,tab2;VIEW~view1", ObjectTypeAndNamePredicateBuilder.FilterType.EXCLUDE);
Predicates<? super Pair<String, String>> predicate = parse.build(Functions.<String>firstOfPair(), (Function<Pair<String, String>, String>) (Function) Functions.<String>secondOfPair());
assertTrue(predicate.accept(Tuples.pair("OTHER", "otherInclude")));
assertFalse(predicate.accept(Tuples.pair("TABLE", "tab1")));
assertFalse(predicate.accept(Tuples.pair("TABLE", "tab2")));
assertTrue(predicate.accept(Tuples.pair("TABLE", "tabNo")));
assertFalse(predicate.accept(Tuples.pair("VIEW", "view1")));
assertTrue(predicate.accept(Tuples.pair("VIEW", "viewInclude")));
}
}
内容来源于网络,如有侵权,请联系作者删除!