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