本文整理汇总了Java中jloda.util.Pair.getSecond方法的典型用法代码示例。如果您正苦于以下问题:Java Pair.getSecond方法的具体用法?Java Pair.getSecond怎么用?Java Pair.getSecond使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jloda.util.Pair
的用法示例。
在下文中一共展示了Pair.getSecond方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hasNext
import jloda.util.Pair; //导入方法依赖的package包/类
/**
* Returns <tt>true</tt> if the iteration has more elements. (In other
* words, returns <tt>true</tt> if <tt>next</tt> would return an element
* rather than throwing an exception.)
*
* @return <tt>true</tt> if the getLetterCodeIterator has more elements.
*/
public boolean hasNext() {
if (error || currentClass == null)
return false;
if (currentCount < currentClass.getFirst())
return true;
currentClass = null;
while (classes.size() > 0) {
currentCount = 0;
Pair<Integer, Long> next = classes.remove(0);
if (next != null && next.getFirst() > 0 && next.getSecond() >= 0) {
try {
classDumpReader.seek(next.getSecond());
} catch (IOException e) {
Basic.caught(e);
return false;
}
currentClass = next;
return true;
}
}
return false;
}
示例2: getPos
import jloda.util.Pair; //导入方法依赖的package包/类
public long getPos(Integer key) {
Pair<Integer, Long> pair = id2SumAndPos.get(key);
if (pair == null)
return 0;
else
return pair.getSecond();
}
示例3: ReadBlockIteratorRMA2
import jloda.util.Pair; //导入方法依赖的package包/类
/**
* constructor
*
* @param wantReadText
* @param wantMatchData
* @param wantMatchText
* @param minScore
* @param file
* @throws java.io.IOException
*/
public ReadBlockIteratorRMA2(String classification, Collection<Integer> classIds, boolean wantReadText, boolean wantMatchData, boolean wantMatchText, float minScore, float maxExpected, File file) throws IOException {
this.wantReadText = wantReadText;
this.wantMatchData = wantMatchData;
this.wantMatchText = wantMatchText;
this.minScore = minScore;
this.maxExpected = maxExpected;
RMA2File rma2File = new RMA2File(file);
dataIndexReader = rma2File.getDataIndexReader();
InfoSection infoSection = rma2File.loadInfoSection();
rma2Formatter = infoSection.getRMA2Formatter();
if (wantReadText || wantMatchText)
textStorageReader = new TextStorageReader(infoSection.getLocationManager(file));
else
textStorageReader = null;
Map<Integer, Pair<Integer, Long>> map = ClassificationBlockRMA2.getCountAndPos(rma2File, classification);
for (Integer classId : classIds) {
Pair<Integer, Long> pair = map.get(classId);
if (pair != null && pair.getSecond() >= 0) {
classes.add(pair);
totalReads += pair.getFirst();
}
}
// if(pair!=null)
// System.err.println("classId: "+classId+" size: "+pair.getFirst()+" dumpPos: "+pair.getSecond());
if (totalReads > 0) {
currentClass = classes.remove(0);
currentCount = 0;
classDumpReader = rma2File.getClassificationDumpReader(classification);
classDumpReader.seek(currentClass.getSecond());
} else
classDumpReader = null;
}
示例4: getValue
import jloda.util.Pair; //导入方法依赖的package包/类
public Object getValue(String name) {
for (Pair<String, Object> pair : list) {
if (pair.getFirst().equals(name))
return pair.getSecond();
}
return null;
}
示例5: getItemType
import jloda.util.Pair; //导入方法依赖的package包/类
public Type getItemType(String word) {
Pair<String, Type> pair = map.get(word);
if (pair != null)
return pair.getSecond();
else
return null;
}
示例6: processAlignment
import jloda.util.Pair; //导入方法依赖的package包/类
/**
* compute gap columns for alignment
*
* @param alignment
*/
public void processAlignment(Alignment alignment) {
clear();
if (alignment != null) {
LinkedList<Pair<Integer, Integer>> events = new LinkedList<>();
for (int row = 0; row < alignment.getNumberOfSequences(); row++) {
Lane lane = alignment.getLane(row);
Pair<Integer, Integer> startEvent = new Pair<>(lane.getFirstNonGapPosition(), -1);
events.add(startEvent);
Pair<Integer, Integer> endEvent = new Pair<>(lane.getLastNonGapPosition(), 1);
events.add(endEvent);
}
Pair<Integer, Integer>[] array = (Pair<Integer, Integer>[]) events.toArray(new Pair[events.size()]);
Arrays.sort(array);
int lastStart = 0;
int coverage = 0;
for (Pair<Integer, Integer> event : array) {
if (event.getSecond() == -1) // start
{
if (coverage == 0) {
if (event.getFirst() - 1 >= 0 && lastStart != -1) {
origGapColumns.add(new Pair<>(lastStart, event.getFirst() - 1));
orig2jump.put(lastStart, event.getFirst() - lastStart);
lastStart = -1;
}
}
coverage++;
} else if (event.getSecond() == 1) // end of an interval
{
coverage--;
if (coverage == 0)
lastStart = event.getFirst();
}
}
if (lastStart != -1 && lastStart < alignment.getLength()) {
origGapColumns.add(new Pair<>(lastStart, alignment.getLength()));
orig2jump.put(lastStart, alignment.getLength() - lastStart);
}
originalColumns = alignment.getLength();
for (Pair<Integer, Integer> col : origGapColumns) {
layout2jump.put(col.getFirst() - jumped, orig2jump.get(col.getFirst()));
jumped += orig2jump.get(col.getFirst());
}
/*
for (Pair<Integer, Integer> col : origGapColumns) {
System.err.println("Original gap column: " + col);
System.err.println("jump: " + orig2jump.get(col.getFirst()));
}
for (Pair<Integer, Integer> col : layoutGapColumns) {
System.err.println("Layout gap column: " + col);
System.err.println("jump: " + layout2jump.get(col.getFirst()));
}
System.err.println("Original columns: " + getLastOriginalColumn());
System.err.println("Layout columns: " + getLastLayoutColumn());
*/
}
}