/** * Allocate a new quality score table, based on requested parameters * in this set of tables, without any data in it. The return result * of this table is suitable for acting as a thread-local cache * for quality score values * @return a newly allocated, empty read group x quality score table */ public NestedIntegerArray<RecalDatum> makeQualityScoreTable() { return log == null ? new NestedIntegerArray<RecalDatum>(numReadGroups, qualDimension, eventDimension) : new LoggingNestedIntegerArray<RecalDatum>(log, "QUALITY_SCORE_TABLE", numReadGroups, qualDimension, eventDimension); }
@Override public ExpandingArrayList<VariantDatum> reduce( final ExpandingArrayList<VariantDatum> mapValue, final ExpandingArrayList<VariantDatum> reduceSum ) { reduceSum.addAll( mapValue ); return reduceSum; }
/** * Add all elements present in a int-set. * * @param other the other inset. * * @throws NullPointerException if <code>other</code> is <code>null</code>. * @return <code>true</code> if this set changed due to this operation, <code>false</code> otherwise. */ public boolean addAll(final CountSet other) { return addAll(other.elements,0,other.size); }
@Override public Pair<ExpandingArrayList<Long>, Long> treeReduce(Pair<ExpandingArrayList<Long>, Long> lhs, Pair<ExpandingArrayList<Long>, Long> rhs) { ExpandingArrayList<Long> nt = new ExpandingArrayList<Long>(); nt.addAll(lhs.first); int index = 0; for (Long l : rhs.first) { if (nt.get(index) == null) nt.add(l); else nt.set(index,nt.get(index) + l); index++; } return new Pair<ExpandingArrayList<Long>, Long>(nt, lhs.second + rhs.second); }
public Pair<ExpandingArrayList<Long>, Long> reduceInit() { return new Pair<ExpandingArrayList<Long>, Long>(new ExpandingArrayList<Long>(), 0l); }
private void maybeExpand(int index, E value) { if ( index >= size() ) { ensureCapacity(index+1); // make sure we have space to hold at least index + 1 elements // We need to add null items until we can safely set index to element for ( int i = size(); i <= index; i++ ) add(value); } }
/** * Constructs a new empty allele-list */ public IndexedAlleleList() { alleles = new IndexedSet<>(); }
@Override public A alleleAt(final int index) { return alleles.get(index); } }
@Override public boolean containsAll(final Collection<?> c) { for (final Object o : c) if (!contains(o)) return false; return true; }
@Override public boolean add(final Integer integer) { return add((int) integer); }
/** * Indicates whether there are more than one kmerSize in the set. * * @return {@code true} iff there is more than one kmerSize assembly in the set. */ public boolean hasMultipleKmerSizes() { return kmerSizes.size() > 1; }
/** * Adds a new element to the heap. * * <p>The heap with grow if it runs out of capacity to hold the new element</p> * * @param v the new element. */ public void add(final int v) { // Double capacity if overflow: ensureCapacity(size + 1); addWithoutCheckingCapacity(v); }
/** * Copy the content of the set into an array. * @param dest the destination array. * @throws NullPointerException if <code>dest</code> is <code>null</code>. * @throws ArrayIndexOutOfBoundsException if there is not enough * space after <code>offset</code> in the destination array to hold all values in the set. */ public void copyTo(final int[] dest) { copyTo(dest,0); }
public RODMergingIterator(Collection<Iterator<RODRecordList>> its) { for ( Iterator<RODRecordList> it : its ) { add(it); } }
/** * Set the set contents to a single integer value. * @param value the integer value to set the set to. */ public void setTo(int value) { ensureCapacity(1); size = 1; elements[0] = value; }
@Override public ExpandingArrayList<VariantDatum> treeReduce( final ExpandingArrayList<VariantDatum> lhs, final ExpandingArrayList<VariantDatum> rhs ) { rhs.addAll( lhs ); return rhs; }
/** * Constructs an empty sample-list. */ public IndexedSampleList() { samples = new IndexedSet<>(0); }
@Override public String sampleAt(int sampleIndex) { return samples.get(sampleIndex); } }
@Override public boolean contains(final Object o) { if (o instanceof Integer) { final int i = (Integer)o; return contains(i); } else return false; //To change body of implemented methods use File | Settings | File Templates. }