/** * Returns the number of entries in the map. * * @return the map's size. */ public int size() { return this._map.size(); }
public int size() { synchronized( mutex ) { return m.size(); } } public boolean isEmpty(){
public int getTotalTaskCount() { return tasksById.size(); }
public int size() { return m.size(); } public boolean isEmpty() { return m.isEmpty(); }
public boolean isComplete() { return completedTasks.size() == tasksById.size(); }
private void logQueueStatus() { LOG.info("{} undelivered, of which {} high-priority", nUndeliveredTasks, stalledHighPriorityTasks.size()); LOG.info("{} producers waiting, {} consumers waiting", highPriorityResponses.size(), nWaitingConsumers); LOG.info("{} total workers", workerCatalog.size()); }
private static Map<MethodLocation, List<ExecutionNode>> buildLocationToNodePile(VirtualMachine vm, TIntObjectMap<MethodLocation> addressToLocation) { OpCreator opCreator = getOpCreator(vm, addressToLocation); Map<MethodLocation, List<ExecutionNode>> locationToNodePile = new HashMap<>(); for (MethodLocation location : addressToLocation.values(new MethodLocation[addressToLocation.size()])) { Op op = opCreator.create(location); ExecutionNode node = new ExecutionNode(op); // Most node piles will be a template node and 1+ ExecutionNodes. List<ExecutionNode> pile = new ArrayList<>(2); pile.add(node); locationToNodePile.put(location, pile); } return locationToNodePile; }
public void finishInitializingTags() { int free = decodingRules.size(); coastlineBrokenEncodingType = free++; initMapEncodingRule(0, coastlineBrokenEncodingType, "natural", "coastline_broken"); if (landEncodingType == -1) { landEncodingType = free++; initMapEncodingRule(0, landEncodingType, "natural", "land"); } }
/** * Creates a new <code>TIntObjectHashMap</code> that contains the entries * in the map passed to it. * * @param map the <tt>TIntObjectMap</tt> to be copied. */ public TIntObjectHashMap( TIntObjectMap<? extends V> map ) { this( map.size(), 0.5f, map.getNoEntryKey() ); putAll( map ); }
@Override public long size() { return elements.size(); }
/** {@inheritDoc} */ public boolean equals( Object other ) { if ( ! ( other instanceof TIntObjectMap ) ) { return false; } TIntObjectMap that = ( TIntObjectMap ) other; if ( that.size() != this.size() ) { return false; } try { TIntObjectIterator iter = this.iterator(); while ( iter.hasNext() ) { iter.advance(); int key = iter.key(); Object value = iter.value(); if ( value == null ) { if ( !( that.get( key ) == null && that.containsKey( key ) ) ) { return false; } } else { if ( !value.equals( that.get( key ) ) ) { return false; } } } } catch ( ClassCastException ex ) { // unused. } return true; }
types.add(r); } else { int nid = decodingRules.size() + 1; initMapEncodingRule(tp.additionalAttribute, nid, tp.tag, tp.value); types.add(nid); additionalTypes.add(r); } else { int nid = decodingRules.size() + 1; initMapEncodingRule(tp.additionalAttribute, nid, tp.tag, tp.value); additionalTypes.add(nid); bm.objectNames.put(r, name); } else { int nid = decodingRules.size() + 1; initMapEncodingRule(tp.additionalAttribute, nid, tp.tag, tp.value); additionalTypes.add(nid);
@Test public void shiftIntegerMapKeysRemovesWhenShiftingDown() { TIntObjectMap<String> intToObject = new TIntObjectHashMap<String>(); intToObject.put(1, "one"); intToObject.put(2, "two"); intToObject.put(3, "three"); Utils.shiftIntegerMapKeys(1, -1, intToObject); assertEquals(2, intToObject.size()); assertEquals("two", intToObject.get(1)); assertEquals("three", intToObject.get(2)); }
@Test public void shiftIntegerMapKeysShiftsUpAsExpected() { TIntObjectMap<String> intToObject = new TIntObjectHashMap<String>(); intToObject.put(1, "one"); intToObject.put(2, "two"); intToObject.put(3, "three"); Utils.shiftIntegerMapKeys(1, 2, intToObject); assertEquals(3, intToObject.size()); assertEquals("one", intToObject.get(1)); assertEquals("two", intToObject.get(4)); assertEquals("three", intToObject.get(5)); }
/** * Returns the number of entries in the map. * * @return the map's size. */ public int size() { return this._map.size(); }
/** * {@inheritDoc} */ public int order() { return vertexToEdges.size(); }
@Override public int size() { return wrapped.size(); } }
/** * @return true when flagSearchQuantity vertices are found */ public boolean shouldBreakSearch() { return vertices.size() >= this.maxVertices; }
/** * Creates a new <code>TIntObjectHashMap</code> that contains the entries * in the map passed to it. * * @param map the <tt>TIntObjectMap</tt> to be copied. */ public TIntObjectHashMap( TIntObjectMap<? extends V> map ) { this( map.size(), 0.5f, map.getNoEntryKey() ); putAll( map ); }
/** * Creates a new <code>TIntObjectHashMap</code> that contains the entries * in the map passed to it. * * @param map the <tt>TIntObjectMap</tt> to be copied. */ public TIntObjectHashMap( TIntObjectMap<? extends V> map ) { this( map.size(), 0.5f, map.getNoEntryKey() ); putAll( map ); }