当前位置: 首页>>代码示例>>Java>>正文


Java C.newSizedList方法代码示例

本文整理汇总了Java中org.osgl.util.C.newSizedList方法的典型用法代码示例。如果您正苦于以下问题:Java C.newSizedList方法的具体用法?Java C.newSizedList怎么用?Java C.newSizedList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.osgl.util.C的用法示例。


在下文中一共展示了C.newSizedList方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: check

import org.osgl.util.C; //导入方法依赖的package包/类
private void check(Map<String, Long> newTimestamps) {
    C.List<FsEvent> events = C.newSizedList(3);

    C.Set<String> set0 = C.set(timestamps.keySet());
    C.Set<String> set1 = C.set(newTimestamps.keySet());

    C.Set<String> added = set1.without(set0);
    if (!added.isEmpty()) {
        events.add(createEvent(FsEvent.Kind.CREATE, added));
    }

    C.Set<String> removed = set0.without(set1);
    if (!removed.isEmpty()) {
        events.add(createEvent(FsEvent.Kind.DELETE, removed));
    }

    C.Set<String> retained = set1.withIn(set0);
    C.Set<String> modified = modified(retained, newTimestamps);
    if (!modified.isEmpty()) {
        events.add(createEvent(FsEvent.Kind.MODIFY, modified));
    }

    if (!events.isEmpty()) {
        trigger(events.toArray(new FsEvent[events.size()]));
    }
}
 
开发者ID:actframework,项目名称:actframework,代码行数:27,代码来源:FsChangeDetector.java

示例2: decorate

import org.osgl.util.C; //导入方法依赖的package包/类
static <T> Provider<T> decorate(BeanSpec spec, Provider<T> realProvider, Genie genie) {
    if (realProvider instanceof PostConstructorInvoker) {
        return realProvider;
    }
    Set<Annotation> postProcessors = spec.postProcessors();
    if (postProcessors.isEmpty()) {
        return realProvider;
    }
    C.List<$.T2<Annotation, PostConstructProcessor<T>>> processors = C.newSizedList(postProcessors.size());
    for (Annotation annotation : postProcessors) {
        PostConstructProcessor<T> pcp = genie.postConstructProcessor(annotation);
        processors.add($.T2(annotation, pcp));
    }
    return new PostConstructProcessorInvoker<T>(realProvider, processors);
}
 
开发者ID:osglworks,项目名称:java-di,代码行数:16,代码来源:PostConstructProcessorInvoker.java

示例3: params

import org.osgl.util.C; //导入方法依赖的package包/类
public EndPointTestContext params(String key, Object val, Object ... otherPairs) {
    E.illegalArgumentIf(otherPairs.length % 2 != 0);
    this.params = C.newSizedList(1 + otherPairs.length / 2);
    this.params.add($.T2(key, val));
    for (int i = 0; i < otherPairs.length - 1; ++i) {
        this.params.add($.T2(S.string(otherPairs[i]), otherPairs[i+1]));
    }
    return this;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:10,代码来源:EndPointTestContext.java

示例4: parse

import org.osgl.util.C; //导入方法依赖的package包/类
@Override
public List<Object> parse(String s) {
    JSONArray array = JSON.parseArray(s);
    List<Object> list = C.newSizedList(array.size());
    for (Object o : array) {
        list.add(ValueObject.of(o));
    }
    return list;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:10,代码来源:ListCodec.java

示例5: convertDerived

import org.osgl.util.C; //导入方法依赖的package包/类
<T extends InterceptorMethodMetaInfo> List<T> convertDerived(List<T> interceptors) {
    C.List<T> list = C.newSizedList(interceptors.size());
    for (InterceptorMethodMetaInfo derived : interceptors) {
        list.add((T)derived.extended(this));
    }
    return list;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:8,代码来源:ControllerClassMetaInfo.java

示例6: exceptionClassesOf

import org.osgl.util.C; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private static List<Class<? extends Exception>> exceptionClassesOf(CatchMethodMetaInfo metaInfo) {
    List<String> classNames = metaInfo.exceptionClasses();
    List<Class<? extends Exception>> clsList;
    clsList = C.newSizedList(classNames.size());
    AppClassLoader cl = App.instance().classLoader();
    for (String cn : classNames) {
        clsList.add((Class) $.classForName(cn, cl));
    }
    return clsList;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:12,代码来源:ReflectedHandlerInvoker.java


注:本文中的org.osgl.util.C.newSizedList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。