本文整理汇总了Java中org.aikodi.rejuse.function.Function类的典型用法代码示例。如果您正苦于以下问题:Java Function类的具体用法?Java Function怎么用?Java Function使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Function类属于org.aikodi.rejuse.function包,在下文中一共展示了Function类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GenericTreeReader
import org.aikodi.rejuse.function.Function; //导入依赖的package包/类
private GenericTreeReader(String tagName,
Producer<TYPE, E> defaultConstructor,
Function<TreeNode, ? extends TYPE, ? extends E> constructorWithAttributes,
BiFunction<PARENTTYPE, TreeNode, ? extends TYPE, ? extends E> constructorWithParent,
BiConsumer<TYPE, String, E> textProcessor,
BiConsumer<PARENTTYPE, TYPE, E> closerWithParent,
boolean descend,
List<InternalTreeReader<?, ? super TYPE, ? extends E>> childReaders,
List<InternalTreeReader<?, ? super TYPE, ? extends E>> descendantReaders
) {
super();
this.childReaders = new HashMap<>();
childReaders.forEach(reader -> this.childReaders.put(reader.tagName(), reader));
this.descendantReaders = new HashMap<>();
descendantReaders.forEach(reader -> this.descendantReaders.put(reader.tagName(), reader));
this.descend = descend;
this.tagName = tagName;
this.defaultConstructor = defaultConstructor;
this.constructorWithParent = constructorWithParent;
this.constructorWithAttributes = constructorWithAttributes;
this.textProcessor = textProcessor;
this._closerWithParent = closerWithParent;
}
示例2: declarationTypeSelector
import org.aikodi.rejuse.function.Function; //导入依赖的package包/类
private PredicateSelector<Element> declarationTypeSelector() {
ListContentProvider<Class> contentProvider = new ListContentProvider<Class>() {
@Override
public List<Class> items(Object context) {
return ImmutableList.<Class>of(Declaration.class,Namespace.class,Type.class,Method.class,Variable.class);
}
};
LabelProvider labelProvider = new LabelProvider(){
@Override
public String text(Object object) {
String result = null;
if(object instanceof Class) {
if(object == Declaration.class) {
result = "All declarations";
} else {
result = ((Class) object).getSimpleName();
}
}
return result;
}
};
Function<Class,UniversalPredicate<? super Element, Nothing>,Nothing> function = new Function<Class, UniversalPredicate<? super Element,Nothing>, Nothing>() {
@Override
public UniversalPredicate<? super Element, Nothing> apply(Class argument) throws Nothing {
return new TypePredicate(argument);
}
};
ComboBoxSelector<Class,Element> selector = new ComboBoxSelector<>(contentProvider, labelProvider,function,2);
return selector;
}
示例3: open
import org.aikodi.rejuse.function.Function; //导入依赖的package包/类
public RootNodeFirstConfigurator<TYPE, E, Builder<TYPE,E>> open(String tagName, Function<TreeNode, TYPE, E> producer) {
return new RootNodeFirstConfigurator<TYPE, E, Builder<TYPE,E>>(this, tagName, producer);
}
示例4: RootNodeFirstConfigurator
import org.aikodi.rejuse.function.Function; //导入依赖的package包/类
protected RootNodeFirstConfigurator(P parent, String tagName, Function<TreeNode, TYPE, E> constructorWithNode) {
super(parent, tagName);
requireNotNull(constructorWithNode);
this.constructorWithNode = constructorWithNode;
}
示例5: constructorWithNode
import org.aikodi.rejuse.function.Function; //导入依赖的package包/类
public Function<TreeNode, TYPE, E> constructorWithNode() {
return constructorWithNode;
}
示例6: NodeFirstAddOnCloseConfigurator
import org.aikodi.rejuse.function.Function; //导入依赖的package包/类
private NodeFirstAddOnCloseConfigurator(P parent, String tagName, Function<TreeNode, TYPE, E> constructorWithNode) {
super(parent, tagName);
requireNotNull(constructorWithNode);
this.constructorWithNode = constructorWithNode;
}
示例7: createMapper
import org.aikodi.rejuse.function.Function; //导入依赖的package包/类
@Override
protected Function<Declaration, List<Declaration>,Nothing> createMapper() {
return new JavaDeclarationDecomposer();
}
示例8: mapper
import org.aikodi.rejuse.function.Function; //导入依赖的package包/类
private Function<Declaration,List<Declaration>,Nothing> mapper() {
return new JavaDeclarationDecomposer();
}