本文整理匯總了Java中gnu.trove.map.hash.TLongObjectHashMap.get方法的典型用法代碼示例。如果您正苦於以下問題:Java TLongObjectHashMap.get方法的具體用法?Java TLongObjectHashMap.get怎麽用?Java TLongObjectHashMap.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gnu.trove.map.hash.TLongObjectHashMap
的用法示例。
在下文中一共展示了TLongObjectHashMap.get方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: WaySink
import gnu.trove.map.hash.TLongObjectHashMap; //導入方法依賴的package包/類
public WaySink(TLongObjectHashMap<List<WayRef>> wayRefs, TLongObjectHashMap<NodeCoord> nodes,
TLongObjectHashMap<List<IWaySegment>> segmentedWaySegments, TLongObjectHashMap<List<Relation>> wayRelations,
BlockingQueue<IWaySegment> waysQueue) {
this.wayRefs = wayRefs;
this.nodes = nodes;
this.wayRelations = wayRelations;
this.segmentedWaySegments = segmentedWaySegments;
for (long nodeId : wayRefs.keys()) {
List<WayRef> wayRefList = wayRefs.get(nodeId);
for (WayRef wayRef : wayRefList) {
if (wayRef.getType() == 2) {
if (waysToSegment.get(wayRef.getWayId()) == null) {
waysToSegment.put(wayRef.getWayId(), new TLongArrayList(new long[] {nodeId}));
} else {
waysToSegment.get(wayRef.getWayId()).add(nodeId);
}
}
}
}
this.waysQueue = waysQueue;
this.connectionsBuilder = new ConnectionsBuilder();
}
示例2: SegmentationWaySink
import gnu.trove.map.hash.TLongObjectHashMap; //導入方法依賴的package包/類
public SegmentationWaySink(TLongObjectHashMap<List<WayRef>> wayRefs, TLongObjectHashMap<List<Relation>> wayRelations,
BlockingQueue<IWaySegment> waysQueue) {
this.wayRefs = wayRefs;
this.wayRelations = wayRelations;
for (long nodeId : wayRefs.keys()) {
List<WayRef> wayRefList = wayRefs.get(nodeId);
for (WayRef wayRef : wayRefList) {
if (wayRef.getType() == 2) {
if (waysToSegment.get(wayRef.getWayId()) == null) {
waysToSegment.put(wayRef.getWayId(), new TLongArrayList(new long[] {nodeId}));
} else {
waysToSegment.get(wayRef.getWayId()).add(nodeId);
}
}
}
}
this.waysQueue = waysQueue;
connectionsBuilder = new ConnectionsBuilder();
}
示例3: aggregate
import gnu.trove.map.hash.TLongObjectHashMap; //導入方法依賴的package包/類
public boolean aggregate() {
if (size == 0) return false;
boolean aggregated = false;
//HashMap<Long, MatrixEntry> table = new HashMap<Long, MatrixEntry>();
TLongObjectHashMap<Entry> table = new TLongObjectHashMap<Entry>();
for (int i = 0; i < size; ++i) {
int id = x[i];
Entry item = table.get(id);
if (item != null) {
item.value += va[i];
aggregated = true;
} else
table.put(id, new Entry(id, va[i]));
}
if (!aggregated) return false;
int p = 0;
for (Entry e : table.valueCollection()) {
if (e.value != 0) {
x[p] = e.x;
va[p] = e.value;
++p;
}
}
size = p;
return true;
}
示例4: createSplitRoad
import gnu.trove.map.hash.TLongObjectHashMap; //導入方法依賴的package包/類
public List<IShape> createSplitRoad(final Way way, final Map<String, Object> values,
final TLongHashSet intersectionNodes, final TLongObjectHashMap<GamaShape> nodesPt) {
final List<List<IShape>> pointsList = GamaListFactory.create(Types.LIST.of(Types.GEOMETRY));
List<IShape> points = GamaListFactory.create(Types.GEOMETRY);
final IList<IShape> geometries = GamaListFactory.create(Types.GEOMETRY);
final WayNode endNode = way.getWayNodes().get(way.getWayNodes().size() - 1);
for (final WayNode node : way.getWayNodes()) {
final Long id = node.getNodeId();
final GamaShape pt = nodesPt.get(id);
if (pt == null) {
continue;
}
points.add(pt);
if (intersectionNodes.contains(id) || node == endNode) {
if (points.size() > 1) {
pointsList.add(points);
}
points = GamaListFactory.create(Types.GEOMETRY);
points.add(pt);
}
}
for (final List<IShape> pts : pointsList) {
final IShape g = createRoad(pts, values);
if (g != null) {
geometries.add(g);
}
}
return geometries;
}
示例5: index
import gnu.trove.map.hash.TLongObjectHashMap; //導入方法依賴的package包/類
private void index(long key, int val, TLongObjectHashMap<TIntArrayList> map) {
TIntArrayList list = map.get(key);
if (list == null) {
list = new TIntArrayList(Constants.DEFAULT_CAPACITY, -1);
map.put(key, list);
}
if (list.contains(val))
return;
list.add(val);
}
示例6: getLinks
import gnu.trove.map.hash.TLongObjectHashMap; //導入方法依賴的package包/類
private List<ProcessLink> getLinks(long processId,
TLongObjectHashMap<TIntArrayList> map) {
TIntArrayList list = map.get(processId);
if (list == null)
return Collections.emptyList();
return getLinks(list.iterator());
}
示例7: index
import gnu.trove.map.hash.TLongObjectHashMap; //導入方法依賴的package包/類
void index(long key, int val, TLongObjectHashMap<TIntArrayList> map) {
TIntArrayList list = map.get(key);
if (list == null) {
list = new TIntArrayList(Constants.DEFAULT_CAPACITY, -1);
map.put(key, list);
}
if (list.contains(val))
return;
list.add(val);
}
示例8: remove
import gnu.trove.map.hash.TLongObjectHashMap; //導入方法依賴的package包/類
private void remove(long id, int index,
TLongObjectHashMap<TIntArrayList> map) {
TIntArrayList list = map.get(id);
if (list == null)
return;
list.remove(index);
if (list.size() == 0)
map.remove(id);
}
示例9: adapt
import gnu.trove.map.hash.TLongObjectHashMap; //導入方法依賴的package包/類
public IWaySegment adapt(Way way, TLongObjectHashMap<NodeCoord> nodes) {
if (way == null) {
log.error("Way is null");
return null;
}
if (way.getWayNodes() == null) {
log.error("Way " + way.getId() + " has no way nodes");
return null;
}
List<Coordinate> coords = new ArrayList<>();
int i = 0;
for (WayNode wayNode : way.getWayNodes()) {
NodeCoord node = nodes.get(wayNode.getNodeId());
if (node != null) {
coords.add(new Coordinate(node.getX(), node.getY()));
i++;
} else {
log.error("Node " + wayNode.getNodeId() + " not found in cache");
}
}
if (i < 2) {
log.error("Node " + way.getId() + " has no valid geometry");
return null;
}
LineString geometry = GeometryUtils.createLineString(coords.toArray(new Coordinate[0]), srid);
Map<String, String> tags = WayHelper.createTagMap(way);
Long originalWayId;
try {
originalWayId = Long.parseLong(tags.get(WaySegmenter.ORIG_WAY_ID));
} catch (NumberFormatException e) {
originalWayId = way.getId();
}
IWaySegment segment = segmentFactory.newSegment(
way.getId(),
geometry,
(float)geometry.getLength(),
null,
null,
originalWayId,
way.getWayNodes().get(0).getNodeId(),
// TODO: startNodeIndex,
0,
way.getWayNodes().get(way.getWayNodes().size()-1).getNodeId(),
// TODO: endNodeIndex,
way.getWayNodes().size()-1,
null,
null,
null);
setAccess(segment, tags);
setName(segment, tags);
setFrc(segment, tags);
setFormOfWay(segment, tags);
setSpeed(segment, tags);
setLanes(segment, tags);
setBridge(segment, tags);
setTunnel(segment, tags);
setUrban(segment, tags);
// TODO: urban
return segment;
}