/** Returns true if there are available operations left to run */ public boolean isAvailableOps() { if( maxOpsInvoked==0 ) return true; synchronized(rspHandlerForMsgId) { return rspHandlerForMsgId.size() < maxOpsInvoked; } }
@Override public int size() { return table.size(); }
private void writeObject(final ObjectOutputStream os) throws IOException { os.defaultWriteObject(); os.writeObject(tagClassName); os.writeObject(privateCreator); os.writeInt(table.size()); try { table.accept(new IntHashtable.Visitor() { public boolean visit(int key, Object value) { try { os.writeInt(key); os.writeUTF((String) value); return true; } catch (IOException e) { throw new RuntimeException(e); } } }); } catch (Exception e) { throw (IOException) e; } }
private void writeObject(final ObjectOutputStream os) throws IOException { os.defaultWriteObject(); os.writeObject(privateCreator); os.writeInt(table.size()); try { table.accept(new IntHashtable.Visitor() { public boolean visit(int key, Object value) { try { os.writeInt(key); os.writeShort(((VR) value).code); return true; } catch (IOException e) { throw new RuntimeException(e); } } }); } catch (Exception e) { throw (IOException) e; } }
private void addDimseRSPHandler(int msgId, DimseRSPHandler rspHandler) throws InterruptedException { synchronized (rspHandlerForMsgId) { while (maxOpsInvoked > 0 && rspHandlerForMsgId.size() >= maxOpsInvoked) rspHandlerForMsgId.wait(); if (isReadyForDataReceive()) rspHandlerForMsgId.put(msgId, rspHandler); } }
@SuppressWarnings("unchecked") @Override public boolean equals(Object that) { if (!(that instanceof IntHashtable)) return false; IntHashtable<T> other = (IntHashtable<T>) that; if (other.size() != count) { return false; } for (int i = 0; i < values.length; ++i) { Object v = values[i]; if (v != null && !v.equals(other.get(keyList[i]))) return false; } return equals(value0, other.value0);// && equals(value_1, // other.value_1); }