/** * Gets the name of the current field * * @return the name of the current field. */ protected String curName() { return nameStack.peekLast(); }
@Override public void write(int datum) throws IOException { if (this.closed) { throw new IOException("Stream closed"); } else { if (this.buffers.peekLast() == null || this.buffers.getLast().length == this.index) { addBuffer(1); } // store the byte this.buffers.getLast()[this.index++] = (byte) datum; } }
@Override public BaseDanmaku last() { if (items != null && !items.isEmpty()) { if (mSortType == ST_BY_LIST) { return ((LinkedList<BaseDanmaku>) items).peekLast(); } return ((SortedSet<BaseDanmaku>) items).last(); } return null; }
/** * Create a new buffer and store it in the LinkedList * <p>Adds a new buffer that can store at least {@code minCapacity} bytes. */ private void addBuffer(int minCapacity) { if (this.buffers.peekLast() != null) { this.alreadyBufferedSize += this.index; this.index = 0; } if (this.nextBlockSize < minCapacity) { this.nextBlockSize = nextPowerOf2(minCapacity); } this.buffers.add(new byte[this.nextBlockSize]); this.nextBlockSize *= 2; // block size doubles each time }
public E peekLast() { lock.lock(); try { return list.size() == 0 ? null : list.peekLast(); } finally { lock.unlock(); } }
public PassportState getState() { return history.peekLast().getState(); }
private synchronized long getAverageRenderingTime() { int frames = mDrawTimes.size(); if(frames <= 0) return 0; Long first = mDrawTimes.peekFirst(); Long last = mDrawTimes.peekLast(); if (first == null || last == null) { return 0; } long dtime = last - first; return dtime / frames; }
@Override public void write(int datum) throws IOException { if (this.closed) { throw new IOException("Stream closed"); } else { if (this.buffers.peekLast() == null || this.buffers.getLast().length == this.index) { addBuffer(1); } // store the byte this.buffers.getLast()[this.index++] = (byte) datum; } }
public boolean add(MessageId messageId) { writeLock.lock(); try { ConcurrentOpenHashSet<MessageId> partition = timePartitions.peekLast(); messageIdPartitionMap.put(messageId, partition); return partition.add(messageId); } finally { writeLock.unlock(); } }
/** * Create a new buffer and store it in the LinkedList * <p>Adds a new buffer that can store at least {@code minCapacity} bytes. */ private void addBuffer(int minCapacity) { if (this.buffers.peekLast() != null) { this.alreadyBufferedSize += this.index; this.index = 0; } if (this.nextBlockSize < minCapacity) { this.nextBlockSize = nextPowerOf2(minCapacity); } this.buffers.add(new byte[this.nextBlockSize]); this.nextBlockSize *= 2; // block size doubles each time }
if (this.buffers.peekLast() == null || this.buffers.getLast().length == this.index) { addBuffer(length);
public MemStoreSize getTailSize() { LinkedList<? extends Segment> localCopy = readOnlyCopy; return localCopy.isEmpty()? new MemStoreSize(): localCopy.peekLast().getMemStoreSize(); }
if (this.buffers.peekLast() == null || this.buffers.getLast().length == this.index) { addBuffer(length);
private MixtureComponentSetScores getStoredScores(long frameFirstSample) { if (storedScores.isEmpty()) return null; if (storedScores.peekLast().getFrameStartSample() < frameFirstSample) //new frame return null; for (MixtureComponentSetScores scores : storedScores) { if (scores.getFrameStartSample() == frameFirstSample) return scores; } //Failed to find score. Seems it wasn't calculated yet return null; }
int len = result1.length(); while (outer.size() > 0 && i < len) { LinkedList<Character> sub = outer.peekLast(); while (sub.size() > 0 && i < len) { char curr = result1.charAt(i++); throw new IllegalArgumentException("语法错误, 可能圆括号没有闭合"); char result = evalWithinParentheses(outer.peekLast()); return result == '1';
public PassportState getState() { return history.peekLast().getState(); }
LayerInfo createLayer(ResourceInfo r, String name, NamespaceInfo ns) { String lId = newId(); StyleInfo s = styles.peekLast();