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


Java CityGMLClass.fromInt方法代码示例

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


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

示例1: lookupDB

import org.citygml4j.model.citygml.CityGMLClass; //导入方法依赖的package包/类
@Override
public String lookupDB(long id, CityGMLClass type) throws SQLException {
	// since we cannot determine the partition by id we have to check all of them. 
	// this is definitely a drawback of this partitions approach  			
	for (int i = 0; i < partitions; i++) {
		final ReentrantLock tableLock = locks[i];
		tableLock.lock();

		try {
			ResultSet rs = null;
			try {
				psLookupDbIds[i].setLong(1, id);
				rs = psLookupDbIds[i].executeQuery();

				while (rs.next()) {
					CityGMLClass dbType = CityGMLClass.fromInt(rs.getInt(2));
					if (!type.isInstance(dbType))
						continue;

					return rs.getString(1);
				}		
			} finally {
				if (rs != null) {
					try {
						rs.close();
					} catch (SQLException sqlEx) {
						//
					}

					rs = null;
				}
			}		
		} finally {
			tableLock.unlock();
		}
	}

	return null;
}
 
开发者ID:3dcitydb,项目名称:importer-exporter-oracle,代码行数:40,代码来源:DBExportCache.java

示例2: lookupDB

import org.citygml4j.model.citygml.CityGMLClass; //导入方法依赖的package包/类
public GmlIdEntry lookupDB(String key) throws SQLException {
	if (createHeapView.compareAndSet(false, true)) 
		deriveHeapCacheTables();

	// wait for heap views to be created
	if (!isHeapCreated) {
		final ReentrantLock lock = this.mainLock;
		lock.lock();

		try {
			while (!isHeapCreated)
				heapCreationDone.await();
		} catch (InterruptedException ie) {
			//
		} finally {
			lock.unlock();
		}
	}

	// determine partition for gml:id
	int partition = Math.abs(key.hashCode() % partitions);

	// lock partition
	final ReentrantLock tableLock = this.locks[partition];
	tableLock.lock();

	try {
		ResultSet rs = null;	
		try {
			psLookupGmlIds[partition].setString(1, key);
			rs = psLookupGmlIds[partition].executeQuery();

			if (rs.next()) {
				long id = rs.getLong(1);
				long rootId = rs.getLong(2);
				boolean reverse = rs.getBoolean(3);
				String mapping = rs.getString(4);
				int type = rs.getInt(5);

				return new GmlIdEntry(id, rootId, reverse, mapping, CityGMLClass.fromInt(type));
			}

			return null;
		} finally {
			if (rs != null) {
				try {
					rs.close();
				} catch (SQLException sqlEx) {
					//
				}

				rs = null;
			}
		}	
	} finally {
		tableLock.unlock();
	}
}
 
开发者ID:3dcitydb,项目名称:importer-exporter-oracle,代码行数:59,代码来源:DBImportCache.java


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