private int getActiveShaderProgramId() { return disposalAction.shaderPrograms.get(activeFeaturesMask); }
/** * Retrieves the value for <tt>key</tt> * * @param key an <code>Object</code> value * @return the value of <tt>key</tt> or null if no such mapping exists. */ public Integer get( Object key ) { int k; if ( key != null ) { if ( key instanceof Integer ) { k = unwrapKey( key ); } else { return null; } } else { k = _map.getNoEntryKey(); } int v = _map.get( k ); // There may be a false positive since primitive maps // cannot return null, so we have to do an extra // check here. if ( v == _map.getNoEntryValue() ) { return null; } else { return wrapValue( v ); } }
/** {@inheritDoc} */ @Override public boolean equals( Object other ) { if ( ! ( other instanceof TIntIntMap ) ) { return false; } TIntIntMap that = ( TIntIntMap ) other; if ( that.size() != this.size() ) { return false; } int[] values = _values; byte[] states = _states; int this_no_entry_value = getNoEntryValue(); int that_no_entry_value = that.getNoEntryValue(); for ( int i = values.length; i-- > 0; ) { if ( states[i] == FULL ) { int key = _set[i]; int that_value = that.get( key ); int this_value = values[i]; if ( ( this_value != that_value ) && ( this_value != this_no_entry_value ) && ( that_value != that_no_entry_value ) ) { return false; } } } return true; }
public int get( int key ) { synchronized( mutex ) { return m.get( key ); } }
public int get( int key) { return m.get( key ); }
@Override public String toString() { StringBuilder sb = new StringBuilder(getName()); sb.append(" ["); int[] keys = targetKeyToOffset.keys(); Arrays.sort(keys); for (int key : keys) { int offset = targetKeyToOffset.get(key); sb.append(key).append(" -> :addr_").append(offset).append(", "); } sb.setLength(sb.length() - 2); sb.append(']'); return sb.toString(); }
if (bins.get(j) > minValToDisplayThisRow) row.append('#'); else
public void display () { int[] lessEqual = new int[maxBin + 1]; System.out.println("--- Histogram: " + title + " ---"); System.out.println(" n == <= >"); int sum = 0; int maxCount = 0; for (int i = minBin; i <= maxBin; i++) { int n = bins.get(i); if (n > maxCount) { maxCount = n; } sum += n; lessEqual[i] = sum; } // Sum now equals the sum of all bins. for (int i = 0; i <= maxBin; i++) { if (((double)lessEqual[i]) / sum > 0.999) { System.out.println("Ending display at 99.9% of total objects."); break; } System.out.printf("%2d: %7d %7d %7d ", i, bins.get(i), lessEqual[i], sum - lessEqual[i]); System.out.print(makeBar(bins.get(i), maxCount)); System.out.print(makeBar(lessEqual[i], sum)); System.out.print(makeBar(sum - lessEqual[i], sum)); System.out.println(); } System.out.println(); }
int linkShaderProgram(int featureHash) { int shaderProgram = GL20.glCreateProgram(); GL20.glAttachShader(shaderProgram, disposalAction.fragmentPrograms.get(featureHash)); GL20.glAttachShader(shaderProgram, disposalAction.vertexPrograms.get(featureHash)); GL20.glLinkProgram(shaderProgram); GL20.glValidateProgram(shaderProgram); return shaderProgram; }
@Override public void execute(ExecutionNode node, MethodState mState) { // Pseudo points to instruction *after* switch op. MethodLocation returnLocation = mState.getPseudoInstructionReturnInstruction(); int branchFromAddress = returnLocation.getCodeAddress() - SWITCH_OP_CODE_UNITS; HeapItem targetItem = mState.readResultRegister(); if (targetItem.isUnknown()) { List<MethodLocation> childList = getTargets(branchFromAddress, targetKeyToOffset); childList.add(returnLocation); MethodLocation[] children = childList.toArray(new MethodLocation[childList.size()]); node.setChildLocations(children); return; } int targetKey = Utils.getIntegerValue(targetItem.getValue()); if (targetKeyToOffset.containsKey(targetKey)) { int targetOffset = branchFromAddress + targetKeyToOffset.get(targetKey); MethodLocation child = addressToLocation.get(targetOffset); node.setChildLocations(child); return; } // Branch target is unspecified. Continue to next op. node.setChildLocations(returnLocation); }
private void checkMaxVisits(ExecutionNode node, VirtualMethod localMethod, TIntIntMap addressToVisitCount) throws MaxAddressVisitsExceededException, MaxMethodVisitsExceededException { if (totalVisits > getMaxMethodVisits()) { throw new MaxMethodVisitsExceededException(node, localMethod.getSignature()); } int address = node.getAddress(); int visitCount = addressToVisitCount.get(address); if (visitCount > getMaxAddressVisits()) { throw new MaxAddressVisitsExceededException(node, localMethod.getSignature()); } boolean adjusted = addressToVisitCount.adjustValue(address, 1); if (!adjusted) { addressToVisitCount.put(address, 1); } }
int stopIndex = indexForStop.get(tstop.getIndex());
for (Stop stop : pattern.getStops()) { int vidx = graph.index.stopVertexForStop.get(stop).getIndex(); int stopIndex = indexForStop.get(vidx); if (stopIndex == -1) { stopIndex = indexForStop.size(); .mapToInt(t -> indexForStop.get(t.index)) .toArray(); int targetStopIndex = indexForStop.get(simpleTransfer.getToVertex().getIndex()); if (targetStopIndex != -1) { transfers.add(targetStopIndex); tranIt.advance(); transfers.add(indexForStop.get(tranIt.key())); if (!out.containsKey(s.index) || out.get(s.index) > time) out.put(s.index, time); int index = indexForStop.get(tstop.getIndex());
synchronized boolean holdsReadLock(int clientIndex) { return !isAnonymous(clientIndex) && readLockHolders != null && readLockHolders.get(clientIndex) > 0; }
@Override public int[] _get(int vecid) { int[] result = new int[lengths.get(vecid)]; _get(vecid, result); return result; }
@Override public final int getInt(int index) { this.checkBounds(index, length); return values.get(index); }
@Override public final long getLong(int index) { this.checkBounds(index, length); return values.get(index); }
@Override @Deprecated public DBID get(DBIDRef id) { return DBIDUtil.importInteger(map.get(DBIDUtil.asInteger(id))); }
@Override public final void forEachEntry(IndexConsumer<Integer> consumer) { final int size = size(); for (int i = 0; i < size; ++i) { final Integer key = keyArray().getValue(i); final int index = indexMap.get(key); consumer.accept(key, index); } }