/** Performs the cache operations for the given key. */ private void process(long key) { IntPriorityQueue times = accessTimes.get(key); int lastAccess = times.dequeueInt(); boolean found = data.remove(lastAccess); if (times.isEmpty()) { data.add(infiniteTimestamp--); accessTimes.remove(key); } else { data.add(times.firstInt()); } if (found) { policyStats.recordHit(); } else { policyStats.recordMiss(); if (data.size() > maximumSize) { evict(); } } }
@Override public int enabledCount() { return this.max_size - this.free.size(); }
public int size() { return length - garbageQueue.size(); }
public int size() { return length - garbageQueue.size(); }
private List<KmerPathNode> lengthSplit(IntSortedSet startPositions, List<KmerPathNode> path) { List<KmerPathNode> result = new ArrayList<KmerPathNode>(startPositions.size()); for (int i = 0; i < path.size(); i++) { KmerPathNode pn = path.get(i); // break node internally for (int breakStartPosition : startPositions.subSet(pn.firstStart() + 1, pn.firstStart() + pn.length())) { int breakLength = breakStartPosition - pn.firstStart(); KmerPathNode split = lengthSplit(pn, breakLength); result.add(split); } result.add(pn); } return result; } private KmerPathNode lengthSplit(KmerPathNode node, int length) {
/** Performs the cache operations for the given key. */ private void process(long key) { IntPriorityQueue times = accessTimes.get(key); int lastAccess = times.dequeueInt(); boolean found = data.remove(lastAccess); if (times.isEmpty()) { data.add(infiniteTimestamp--); accessTimes.remove(key); } else { data.add(times.firstInt()); } if (found) { policyStats.recordHit(); } else { policyStats.recordMiss(); if (data.size() > maximumSize) { evict(); } } }
/** Checks whether this interval is equal to another set of integers. * * @param o an object. * @return true if <code>o</code> is an ordered set of integer containing * the same element of this interval in the same order, or if <code>o</code> * is a set of integers containing the same elements of this interval. */ public boolean equals( final Object o ) { if ( o instanceof Interval ) return ((Interval)o).left == left && ((Interval)o).right == right; else if ( o instanceof IntSortedSet ) { // For sorted sets, we require the same order IntSortedSet s = (IntSortedSet) o; if ( s.size() != length() ) return false; int n = length(); IntIterator i = iterator(), j = s.iterator(); while( n-- != 0 ) if ( i.nextInt() != j.nextInt() ) return false; return true; } else if ( o instanceof IntSet ) { // For sets, we just require the same elements IntSet s = (IntSet) o; if ( s.size() != length() ) return false; int n = length(); IntIterator i = iterator(); while( n-- != 0 ) if ( ! s.contains( i.nextInt() ) ) return false; return true; } else return false; } }
/** Checks whether this interval is equal to another set of integers. * * @param o an object. * @return true if <code>o</code> is an ordered set of integer containing * the same element of this interval in the same order, or if <code>o</code> * is a set of integers containing the same elements of this interval. */ public boolean equals( final Object o ) { if ( o instanceof Interval ) return ((Interval)o).left == left && ((Interval)o).right == right; else if ( o instanceof IntSortedSet ) { // For sorted sets, we require the same order IntSortedSet s = (IntSortedSet) o; if ( s.size() != length() ) return false; int n = length(); IntIterator i = iterator(), j = s.iterator(); while( n-- != 0 ) if ( i.nextInt() != j.nextInt() ) return false; return true; } else if ( o instanceof IntSet ) { // For sets, we just require the same elements IntSet s = (IntSet) o; if ( s.size() != length() ) return false; int n = length(); IntIterator i = iterator(); while( n-- != 0 ) if ( ! s.contains( i.nextInt() ) ) return false; return true; } else return false; } }
else if (o instanceof IntSortedSet) { // For sorted sets, we require the same order IntSortedSet s = (IntSortedSet) o; if (s.size() != length()) return false; int n = length(); IntIterator i = iterator(), j = s.iterator();