本文整理汇总了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()]));
}
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}