本文整理了Java中java.util.ArrayDeque.getLast()
方法的一些代码示例,展示了ArrayDeque.getLast()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ArrayDeque.getLast()
方法的具体详情如下:
包路径:java.util.ArrayDeque
类名称:ArrayDeque
方法名:getLast
暂无
代码示例来源:origin: org.apache.lucene/lucene-core
private void appendBlock() {
if (blocks.size() >= MAX_BLOCKS_BEFORE_BLOCK_EXPANSION && blockBits < maxBitsPerBlock) {
rewriteToBlockSize(blockBits + 1);
if (blocks.getLast().hasRemaining()) {
return;
}
}
final int requiredBlockSize = 1 << blockBits;
currentBlock = blockAllocate.apply(requiredBlockSize);
assert currentBlock.capacity() == requiredBlockSize;
blocks.add(currentBlock);
}
代码示例来源:origin: org.apache.lucene/lucene-core
/**
* @return The number of bytes written to this output so far.
*/
public long size() {
long size = 0;
int blockCount = blocks.size();
if (blockCount >= 1) {
int fullBlockSize = (blockCount - 1) * blockSize();
int lastBlockSize = blocks.getLast().position();
size = fullBlockSize + lastBlockSize;
}
return size;
}
代码示例来源:origin: apache/pulsar
void internalFlushPendingMarkDeletes() {
MarkDeleteEntry lastEntry = pendingMarkDeleteOps.getLast();
lastEntry.callbackGroup = Lists.newArrayList(pendingMarkDeleteOps);
pendingMarkDeleteOps.clear();
internalMarkDelete(lastEntry);
}
代码示例来源:origin: apache/flume
public void putPrimary(Integer eventCount) {
totalPuts += eventCount;
if ((queue.peekLast() == null) || queue.getLast().intValue() < 0) {
queue.addLast(new MutableInteger(eventCount));
} else {
queue.getLast().add(eventCount);
}
}
代码示例来源:origin: apache/flume
public void putOverflow(Integer eventCount) {
totalPuts += eventCount;
if ((queue.peekLast() == null) || queue.getLast().intValue() > 0) {
queue.addLast(new MutableInteger(-eventCount));
} else {
queue.getLast().add(-eventCount);
}
overflowCounter += eventCount;
}
代码示例来源:origin: google/ExoPlayer
@Override
public PlaybackParameters setPlaybackParameters(PlaybackParameters playbackParameters) {
if (isInitialized() && !canApplyPlaybackParameters) {
this.playbackParameters = PlaybackParameters.DEFAULT;
return this.playbackParameters;
}
PlaybackParameters lastSetPlaybackParameters =
afterDrainPlaybackParameters != null
? afterDrainPlaybackParameters
: !playbackParametersCheckpoints.isEmpty()
? playbackParametersCheckpoints.getLast().playbackParameters
: this.playbackParameters;
if (!playbackParameters.equals(lastSetPlaybackParameters)) {
if (isInitialized()) {
// Drain the audio processors so we can determine the frame position at which the new
// parameters apply.
afterDrainPlaybackParameters = playbackParameters;
} else {
// Update the playback parameters now.
this.playbackParameters = audioProcessorChain.applyPlaybackParameters(playbackParameters);
}
}
return this.playbackParameters;
}
代码示例来源:origin: google/ExoPlayer
afterDrainPlaybackParameters = null;
} else if (!playbackParametersCheckpoints.isEmpty()) {
playbackParameters = playbackParametersCheckpoints.getLast().playbackParameters;
代码示例来源:origin: apache/kafka
long lastInnerOffset = innerEntries.getLast().offset();
if (lastOffsetFromWrapper < lastInnerOffset)
throw new InvalidRecordException("Found invalid wrapper offset in compressed v1 message set, " +
代码示例来源:origin: deeplearning4j/nd4j
val frameName = frames.getLast();
val frame_name = frames.getLast();
val frame_name = frames.getLast();
val frame_name = frames.size() > 0 ? frames.getLast() : null;
代码示例来源:origin: BaseXdb/basex
/**
* Returns the current variable scope.
* @return variable scope
*/
public VarScope vs() {
return scopes.getLast();
}
代码示例来源:origin: org.apache.chemistry.opencmis/chemistry-opencmis-test-util
public long getLastTime() {
TimeRecord lastRec = fTimeRecs.getLast();
if (null != lastRec) {
return lastRec.fStop - lastRec.fStart;
} else {
return 0;
}
}
代码示例来源:origin: org.basex/basex
/**
* Returns the current variable scope.
* @return variable scope
*/
public VarScope vs() {
return scopes.getLast();
}
代码示例来源:origin: us.ihmc/IHMCCommunication
/**
* Warning: The returned element will be reused and modified by this deque when adding a new element.
* {@inheritDoc}
*/
@Override
public C getLast()
{
C commandToReturn = super.getLast();
unusedCommands.add(commandToReturn);
return commandToReturn;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene
private void appendBlock() {
if (blocks.size() >= MAX_BLOCKS_BEFORE_BLOCK_EXPANSION && blockBits < maxBitsPerBlock) {
rewriteToBlockSize(blockBits + 1);
if (blocks.getLast().hasRemaining()) {
return;
}
}
final int requiredBlockSize = 1 << blockBits;
currentBlock = blockAllocate.apply(requiredBlockSize);
assert currentBlock.capacity() == requiredBlockSize;
blocks.add(currentBlock);
}
代码示例来源:origin: org.apache.pulsar/managed-ledger-original
void internalFlushPendingMarkDeletes() {
MarkDeleteEntry lastEntry = pendingMarkDeleteOps.getLast();
lastEntry.callbackGroup = Lists.newArrayList(pendingMarkDeleteOps);
pendingMarkDeleteOps.clear();
internalMarkDelete(lastEntry);
}
代码示例来源:origin: thankjava/smartqq-agreement-core
public double getAverageValueOfOneSecond() {
if (frequencyData.size() < ConfigParams.MONITOR_THE_NUMBER_OF_DATA_SAMPLES) {
return 0;
}
long first = frequencyData.getFirst();
long last = frequencyData.getLast();
long timeSecond = (last - first) / 1000;
return MathUtil.divide(ConfigParams.MONITOR_THE_NUMBER_OF_DATA_SAMPLES, timeSecond, 0);
}
}
代码示例来源:origin: org.apache.flume.flume-ng-channels/flume-spillable-memory-channel
public void putOverflow(Integer eventCount) {
totalPuts += eventCount;
if ((queue.peekLast() == null) || queue.getLast().intValue() > 0) {
queue.addLast(new MutableInteger(-eventCount));
} else {
queue.getLast().add(-eventCount);
}
overflowCounter += eventCount;
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
public void end(Tag tag) {
if (!enabled()) {
return;
}
if (!this.operationStack.getLast().equals(tag)) {
throw new IllegalStateException();
}
this.operationStack.removeLast();
addToQueue(POP_OPERATION, 0, tag.opNum);
}
代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core
public void end(Tag tag) {
if (!enabled()) {
return;
}
if (!this.operationStack.getLast().equals(tag)) {
throw new IllegalStateException();
}
this.operationStack.removeLast();
addToQueue(POP_OPERATION, 0, tag.opNum);
}
代码示例来源:origin: PapenfussLab/gridss
private ArrayDeque<KmerPathSubnode> extendStartingAnchor(ArrayDeque<KmerPathSubnode> contig, int targetAnchorLength) {
KmerPathNodePath startAnchorPath = new KmerPathNodePath(contig.getLast(), false, targetAnchorLength + maxEvidenceSupportIntervalWidth + contig.stream().mapToInt(sn -> sn.length()).sum());
Iterator<KmerPathSubnode> it = contig.descendingIterator();
it.next();
startAnchorPath.push(it);
startAnchorPath.greedyTraverse(true, false);
return startAnchorPath.headNode().asSubnodes();
}
private boolean containsKmerRepeat(Collection<KmerPathSubnode> contig) {
内容来源于网络,如有侵权,请联系作者删除!