本文整理了Java中org.eclipse.collections.api.block.function.Function
类的一些代码示例,展示了Function
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Function
类的具体详情如下:
包路径:org.eclipse.collections.api.block.function.Function
类名称:Function
[英]Function is a one-argument lambda which performs a transformation on the object of type Tpassed to the valueOf() method. This transformation can return the value of calling a getter, or perform some more elaborate logic to calculate a value, of type V.
[中]函数是一个单参数lambda,它对类型为Tpassed的对象执行转换,转换为valueOf()方法。这个转换可以返回调用getter的值,或者执行一些更复杂的逻辑来计算V类型的值。
代码示例来源:origin: eclipse/eclipse-collections
@Override
public <P> V getIfAbsentWith(
K key,
Function<? super P, ? extends V> function,
P parameter)
{
return function.valueOf(parameter);
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
default V apply(T each)
{
return this.valueOf(each);
}
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public <P> V getIfAbsentWith(
K key,
Function<? super P, ? extends V> function,
P parameter)
{
return function.valueOf(parameter);
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public V valueOf(T anObject)
{
V returnValue = this.function.valueOf(anObject);
if (returnValue == null)
{
return this.defaultValue;
}
return returnValue;
}
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public V valueOf(T object)
{
return object == null ? this.nullValue : this.function.valueOf(object);
}
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public T3 valueOf(T1 object)
{
return this.function2.valueOf(this.function1.valueOf(object));
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public <P> V getIfAbsentWith(
K key,
Function<? super P, ? extends V> function,
P parameter)
{
return function.valueOf(parameter);
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public T3 valueOf(T1 object)
{
return this.function2.valueOf(this.function1.valueOf(object));
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public T value(T argument1, T argument2)
{
V first = this.function.valueOf(argument1);
V second = this.function.valueOf(argument2);
return first.compareTo(second) < 0 ? argument2 : argument1;
}
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public <A> A ifPresentApply(K key, Function<? super V, ? extends A> function)
{
V result = this.delegate.get(key);
return result == null ? null : function.valueOf(result);
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public <VV, R extends Collection<VV>> R collect(Function<? super V, ? extends VV> function, R target)
{
target.add(function.valueOf(this.value1));
return target;
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public <VV, R extends Collection<VV>> R collect(Function<? super V, ? extends VV> function, R target)
{
target.add(function.valueOf(this.value1));
return target;
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public <VV, R extends Collection<VV>> R collect(Function<? super V, ? extends VV> function, R target)
{
target.add(function.valueOf(this.value1));
return target;
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public int computeHashCode(T object)
{
return this.function.valueOf(object).hashCode();
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public <NK, NV> MutableSortedMap<NK, NV> toSortedMap(Comparator<? super NK> comparator, Function<? super V, ? extends NK> keyFunction, Function<? super V, ? extends NV> valueFunction)
{
return SortedMaps.mutable.with(keyFunction.valueOf(this.value1), valueFunction.valueOf(this.value1));
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public <NK, NV> MutableSortedMap<NK, NV> toSortedMap(Function<? super V, ? extends NK> keyFunction, Function<? super V, ? extends NV> valueFunction)
{
return SortedMaps.mutable.with(keyFunction.valueOf(this.value1), valueFunction.valueOf(this.value1));
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public <NK, NV> MutableSortedMap<NK, NV> toSortedMap(Comparator<? super NK> comparator, Function<? super V, ? extends NK> keyFunction, Function<? super V, ? extends NV> valueFunction)
{
return SortedMaps.mutable.with(keyFunction.valueOf(this.value1), valueFunction.valueOf(this.value1));
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public <NK, NV> MutableMap<NK, NV> toMap(Function<? super V, ? extends NK> keyFunction, Function<? super V, ? extends NV> valueFunction)
{
return Maps.mutable.with(keyFunction.valueOf(this.value1), valueFunction.valueOf(this.value1));
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public <NK, NV> MutableSortedMap<NK, NV> toSortedMap(Comparator<? super NK> comparator, Function<? super V, ? extends NK> keyFunction, Function<? super V, ? extends NV> valueFunction)
{
return SortedMaps.mutable.with(keyFunction.valueOf(this.value1), valueFunction.valueOf(this.value1));
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public <NK, NV> MutableSortedMap<NK, NV> toSortedMap(Comparator<? super NK> comparator, Function<? super V, ? extends NK> keyFunction, Function<? super V, ? extends NV> valueFunction)
{
return SortedMaps.mutable.with(keyFunction.valueOf(this.value1), valueFunction.valueOf(this.value1));
}
内容来源于网络,如有侵权,请联系作者删除!