本文整理汇总了Java中org.hawk.emfresource.HawkResource.getAllContents方法的典型用法代码示例。如果您正苦于以下问题:Java HawkResource.getAllContents方法的具体用法?Java HawkResource.getAllContents怎么用?Java HawkResource.getAllContents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hawk.emfresource.HawkResource
的用法示例。
在下文中一共展示了HawkResource.getAllContents方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: greedySerialize
import org.hawk.emfresource.HawkResource; //导入方法依赖的package包/类
protected Serializer greedySerialize(final HawkResource resource, IProgressMonitor monitor)
throws Exception, IfcModelInterfaceException {
final int total = resource.getContents().size();
/*
* Greedy loading modes are simple: we already have everything in the
* model, so we can use the standard EMF facilities.
*/
final Serializer serializer = createSerializer(resource);
long oid = 0;
int current = 0, offset = 0;
for (TreeIterator<EObject> it = resource.getAllContents(); it.hasNext();) {
final EObject eo = it.next();
oid = addToSerializer(serializer, oid, eo);
++current;
if (current == REPORTING_BATCH_SIZE) {
offset += current;
current = 0;
monitor.subTask(String.format("Populating IFC serializer (%d/%d)", offset, total));
}
}
return serializer;
}