本文整理汇总了Java中scala.collection.Iterable类的典型用法代码示例。如果您正苦于以下问题:Java Iterable类的具体用法?Java Iterable怎么用?Java Iterable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Iterable类属于scala.collection包,在下文中一共展示了Iterable类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: canBeUsed
import scala.collection.Iterable; //导入依赖的package包/类
@Override
public boolean canBeUsed(Object obj, boolean expand) {
if (!expand)
return false;
if (! (obj instanceof scala.collection.immutable.Seq<?>))
return false;
Collection<?> col = scala.collection.JavaConversions.asJavaCollection((Iterable<?>) obj);
if (col.isEmpty())
return false;
for (Object o : col) {
if (!(o instanceof scala.collection.immutable.Seq))
return false;
Collection<?> col2 = scala.collection.JavaConversions.asJavaCollection((Iterable<?>) o);
for (Object o2 : col2) {
if (!parent.isPrimitiveType(o2.getClass().getName()))
return false;
}
}
return true;
}
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:25,代码来源:ScalaEvaluator.java
示例2: canBeUsed
import scala.collection.Iterable; //导入依赖的package包/类
@Override
public boolean canBeUsed(Object obj, boolean expand) {
if (!expand)
return false;
if (!(obj instanceof scala.collection.immutable.Seq<?>))
return false;
Collection<?> col = scala.collection.JavaConversions.asJavaCollection((Iterable<?>) obj);
if (col.isEmpty())
return false;
for (Object o : col) {
if (!(o instanceof scala.collection.immutable.Seq))
return false;
Collection<?> col2 = scala.collection.JavaConversions.asJavaCollection((Iterable<?>) o);
for (Object o2 : col2) {
if (!parent.isPrimitiveType(o2.getClass().getName()))
return false;
}
}
return true;
}
开发者ID:twosigma,项目名称:beakerx,代码行数:25,代码来源:ScalaPrimitiveTypeListOfListSerializer.java
示例3: writeObject
import scala.collection.Iterable; //导入依赖的package包/类
@Override
public boolean writeObject(Object obj, JsonGenerator jgen, boolean expand) throws JsonProcessingException, IOException {
logger.debug("list of maps");
// convert this 'on the fly' to a datatable
Collection<?> col = scala.collection.JavaConversions.asJavaCollection((Iterable<?>) obj);
List<Map<?,?>> tab = new ArrayList<Map<?,?>>();
for (Object o : col) {
Map<?, ?> row = scala.collection.JavaConversions.mapAsJavaMap((scala.collection.Map<?, ?>) o);
tab.add(row);
}
TableDisplay t = new TableDisplay(tab,parent);
jgen.writeObject(t);
return true;
}
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:15,代码来源:ScalaEvaluator.java
示例4: select
import scala.collection.Iterable; //导入依赖的package包/类
public Object select(String name, Object defaultValue,
scala.collection.Iterable<Tuple2<Object, String>> options) {
int n = options.size();
ParamOption[] paramOptions = new ParamOption[n];
Iterator<Tuple2<Object, String>> it = asJavaIterable(options).iterator();
int i = 0;
while (it.hasNext()) {
Tuple2<Object, String> valueAndDisplayValue = it.next();
paramOptions[i++] = new ParamOption(valueAndDisplayValue._1(), valueAndDisplayValue._2());
}
return gui.select(name, "", paramOptions);
}
开发者ID:lorthos,项目名称:incubator-zeppelin-druid,代码行数:15,代码来源:ZeppelinContext.java
示例5: processFailure
import scala.collection.Iterable; //导入依赖的package包/类
@Override
public void processFailure(ActorContext actorContext, boolean b, ActorRef actorRef,
Throwable throwable, ChildRestartStats childRestartStats,
Iterable<ChildRestartStats> childRestartStatsIterable) {
defaultStrategy().processFailure(actorContext,b,actorRef,throwable,childRestartStats,childRestartStatsIterable);
}
开发者ID:awltech,项目名称:karajan,代码行数:8,代码来源:CustomSupervisorStrategy.java
示例6: handleFailure
import scala.collection.Iterable; //导入依赖的package包/类
@Override
public boolean handleFailure(ActorContext context, ActorRef child,
Throwable caus, ChildRestartStats stats,
Iterable<ChildRestartStats> children) {
cause=caus;
executor=child;
currentrestrart=stats.maxNrOfRetriesCount();
System.out.println("Retrying!!!!!!!"+stats.maxNrOfRetriesCount());
return defaultStrategy().handleFailure(context, child, caus, stats, children);
}
开发者ID:awltech,项目名称:karajan,代码行数:11,代码来源:CustomSupervisorStrategy.java
示例7: writeObject
import scala.collection.Iterable; //导入依赖的package包/类
@Override
public boolean writeObject(Object obj, JsonGenerator jgen, boolean expand) throws JsonProcessingException, IOException {
logger.debug("collection");
// convert this 'on the fly' to an array of objects
Collection<?> c = scala.collection.JavaConversions.asJavaCollection((Iterable<?>) obj);
jgen.writeStartArray();
for (Object o : c) {
if (!parent.writeObject(o, jgen, false))
jgen.writeObject(o.toString());
}
jgen.writeEndArray();
return true;
}
开发者ID:twosigma,项目名称:beakerx,代码行数:14,代码来源:ScalaCollectionSerializer.java
示例8: canBeUsed
import scala.collection.Iterable; //导入依赖的package包/类
@Override
public boolean canBeUsed(Object obj, boolean expand) {
if (!expand)
return false;
if (!(obj instanceof scala.collection.immutable.Seq<?>))
return false;
Collection<?> col = scala.collection.JavaConversions.asJavaCollection((Iterable<?>) obj);
if (col.isEmpty())
return false;
for (Object o : col) {
if (!(o instanceof scala.collection.Map<?, ?>))
return false;
Map<?, ?> m = scala.collection.JavaConversions.mapAsJavaMap((scala.collection.Map<?, ?>) o);
Set<?> keys = m.keySet();
for (Object key : keys) {
if (key != null && !parent.isPrimitiveType(key.getClass().getName()))
return false;
Object val = m.get(key);
if (val != null && !parent.isPrimitiveType(val.getClass().getName()))
return false;
}
}
return true;
}
开发者ID:twosigma,项目名称:beakerx,代码行数:29,代码来源:ScalaListOfPrimitiveTypeMapsSerializer.java
示例9: writeObject
import scala.collection.Iterable; //导入依赖的package包/类
@Override
public boolean writeObject(Object obj, JsonGenerator jgen, boolean expand) throws JsonProcessingException, IOException {
logger.debug("list of maps");
// convert this 'on the fly' to a datatable
Collection<?> col = scala.collection.JavaConversions.asJavaCollection((Iterable<?>) obj);
List<Map<String, Object>> tab = new ArrayList<Map<String, Object>>();
for (Object o : col) {
Map<String, Object> row = scala.collection.JavaConversions.mapAsJavaMap((scala.collection.Map<String, Object>) o);
tab.add(row);
}
TableDisplay t = new TableDisplay(tab, parent);
jgen.writeObject(t);
return true;
}
开发者ID:twosigma,项目名称:beakerx,代码行数:15,代码来源:ScalaListOfPrimitiveTypeMapsSerializer.java
示例10: handleChildTerminated
import scala.collection.Iterable; //导入依赖的package包/类
@Override
public void handleChildTerminated(ActorContext actorContext, ActorRef actorRef,
Iterable<ActorRef> actorRefIterable) {
defaultStrategy().handleChildTerminated(actorContext, actorRef, actorRefIterable);
}
开发者ID:awltech,项目名称:karajan,代码行数:6,代码来源:CustomSupervisorStrategy.java
示例11: load
import scala.collection.Iterable; //导入依赖的package包/类
/**
* Load dependency and it's transitive dependencies for interpreter and runtime (driver).
* And distribute them to spark cluster (sc.add())
*
* @param artifact "groupId:artifactId:version" or file path like "/somepath/your.jar"
* @param excludes exclusion list of transitive dependency. list of "groupId:artifactId" string.
* @return
* @throws Exception
*/
public Iterable<String> load(String artifact, scala.collection.Iterable<String> excludes)
throws Exception {
return collectionAsScalaIterable(
dep.load(artifact,
asJavaCollection(excludes),
true));
}
开发者ID:lorthos,项目名称:incubator-zeppelin-druid,代码行数:17,代码来源:ZeppelinContext.java
示例12: loadLocal
import scala.collection.Iterable; //导入依赖的package包/类
/**
* Load dependency for interpreter and runtime, and then add to sparkContext.
* But not adding them to spark cluster
*
* @param artifact "groupId:artifactId:version" or file path like "/somepath/your.jar"
* @return
* @throws Exception
*/
public Iterable<String> loadLocal(String artifact) throws Exception {
return collectionAsScalaIterable(dep.load(artifact, false));
}
开发者ID:lorthos,项目名称:incubator-zeppelin-druid,代码行数:12,代码来源:ZeppelinContext.java
注:本文中的scala.collection.Iterable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论