public int get(String forUseBy) { if (pool.isEmpty()) { IntBuffer buffer = BufferUtils.createIntBuffer(BUFFER_FETCH_SIZE); GL15.glGenBuffers(buffer); for (int i = 0; i < BUFFER_FETCH_SIZE; ++i) { pool.add(buffer.get(i)); } totalPoolSize += BUFFER_FETCH_SIZE; } int result = pool.removeAt(pool.size() - 1); if (traceBufferUsage) { usageTracker.put(result, forUseBy); } return result; }
if (skippedStops.isEmpty()) { LOG.warn("No stops found to skip on matched trip pattern {}", original); return Arrays.asList(original);
if (!removedStopSequences.isEmpty()) { LOG.warn(graph.addBuilderAnnotation(new RepeatedStops(trip, removedStopSequences)));
if (!transfers.isEmpty()) transfersForStop.add(transfers.toArray()); else
/** * Returns the list of all edges. */ public List<EdgeIteratorState> calcEdges() { final List<EdgeIteratorState> edges = new ArrayList<EdgeIteratorState>(edgeIds.size()); if (edgeIds.isEmpty()) return edges; forEveryEdge(new EdgeVisitor() { @Override public void next( EdgeIteratorState eb, int i ) { edges.add(eb); } }); return edges; }
if (newDistanceTable.isEmpty()) return null; // not near any points in sub pointset else return newDistanceTable.toArray(); })
if (newDistanceTable.isEmpty()) return null; // not near any points in sub pointset else return newDistanceTable.toArray(); })
Fun.Tuple2<String, String> routeKey = entry.getKey(); TIntList waitTimes = entry.getValue(); if (waitTimes.isEmpty()) { continue;
if (modified && bin.isEmpty()) { bins.remove(mapKey); nBins--;
if (modified && bin.isEmpty()) { bins.remove(mapKey); nBins--;
public static List<IntRange> intoRanges(TIntList ids) { if (ids.isEmpty()) { throw new NoSuchElementException(); } List<IntRange> ranges = new ArrayList<>(); if (ids.size() == 1) { return ImmutableList.of(new IntRange(ids.get(0))); } ids.sort(); int start = ids.get(0); int cur = start; for (int id : ids.subList(1, ids.size()).toArray()) { if (cur + 1 == id) { cur = id; } else { ranges.add(new IntRange(start, cur)); start = id; cur = id; } } if (start == cur) { ranges.add(new IntRange(start)); } else { ranges.add(new IntRange(start, cur)); } return ranges; }
if (deltas.isEmpty()) return -1;
/** * @return the uncached node indices of the tower nodes in this path. */ public TIntList calcNodes() { final TIntArrayList nodes = new TIntArrayList(edgeIds.size() + 1); if (edgeIds.isEmpty()) { if (isFound()) { nodes.add(endNode); } return nodes; } int tmpNode = getFromNode(); nodes.add(tmpNode); forEveryEdge(new EdgeVisitor() { @Override public void next( EdgeIteratorState eb, int i ) { nodes.add(eb.getAdjNode()); } }); return nodes; }
final boolean hasTextureCoords; final boolean hasNormals; if (!textureCoordIndices.isEmpty() && !rawTextureCoords.isEmpty()) { textureCoords.fill(0, positions.size() / positionSize * textureCoordSize, 0); hasTextureCoords = true; hasTextureCoords = false; if (!normalIndices.isEmpty() && !rawNormalComponents.isEmpty()) { normals.fill(0, positions.size() / positionSize * normalSize, 0); hasNormals = true;
if (edgeIds.isEmpty())
if (edgeIds.isEmpty())