/** {@inheritDoc} */ public short[] toArray() { short[] result = new short[ size() ]; short[] set = _set; byte[] states = _states; for ( int i = states.length, j = 0; i-- > 0; ) { if ( states[i] == FULL ) { result[j++] = set[i]; } } return result; }
/** {@inheritDoc} */ public boolean equals( Object other ) { if ( ! ( other instanceof TShortSet ) ) { return false; } TShortSet that = ( TShortSet ) other; if ( that.size() != this.size() ) { return false; } for ( int i = _states.length; i-- > 0; ) { if ( _states[i] == FULL ) { if ( ! that.contains( _set[i] ) ) { return false; } } } return true; }
/** {@inheritDoc} */ public short[] toArray() { short[] result = new short[ size() ]; short[] set = _set; byte[] states = _states; for ( int i = states.length, j = 0; i-- > 0; ) { if ( states[i] == FULL ) { result[j++] = set[i]; } } return result; }
/** {@inheritDoc} */ public short[] toArray() { short[] result = new short[ size() ]; short[] set = _set; byte[] states = _states; for ( int i = states.length, j = 0; i-- > 0; ) { if ( states[i] == FULL ) { result[j++] = set[i]; } } return result; }
/** {@inheritDoc} */ @Override public short[] toArray() { short[] result = new short[ size() ]; short[] set = _set; byte[] states = _states; for ( int i = states.length, j = 0; i-- > 0; ) { if ( states[i] == FULL ) { result[j++] = set[i]; } } return result; }
/** {@inheritDoc} */ public boolean equals( Object other ) { if ( ! ( other instanceof TShortSet ) ) { return false; } TShortSet that = ( TShortSet ) other; if ( that.size() != this.size() ) { return false; } for ( int i = _states.length; i-- > 0; ) { if ( _states[i] == FULL ) { if ( ! that.contains( _set[i] ) ) { return false; } } } return true; }
@Override public double compare(final short[] h1, final short[] h2) { TShortHashSet union = new TShortHashSet(h1); union.addAll(h2); TShortHashSet intersection = new TShortHashSet(h1); intersection.retainAll(h2.clone()); //retainAll sorts the input, so we need to make a copy return 1.0 - (((double)intersection.size()) / (double)union.size()); } },
@Override public double compare(final short[] h1, final short[] h2) { TShortHashSet union = new TShortHashSet(h1); union.addAll(h2); TShortHashSet intersection = new TShortHashSet(h1); intersection.retainAll(h2.clone()); //retainAll sorts the input, so we need to make a copy return 1.0 - (((double)intersection.size()) / (double)union.size()); } },
/** {@inheritDoc} */ public boolean equals( Object other ) { if ( ! ( other instanceof TShortSet ) ) { return false; } TShortSet that = ( TShortSet ) other; if ( that.size() != this.size() ) { return false; } for ( int i = _states.length; i-- > 0; ) { if ( _states[i] == FULL ) { if ( ! that.contains( _set[i] ) ) { return false; } } } return true; }
/** {@inheritDoc} */ public boolean equals( Object other ) { if ( ! ( other instanceof TShortSet ) ) { return false; } TShortSet that = ( TShortSet ) other; if ( that.size() != this.size() ) { return false; } for ( int i = _states.length; i-- > 0; ) { if ( _states[i] == FULL ) { if ( ! that.contains( _set[i] ) ) { return false; } } } return true; }
/** {@inheritDoc} */ @Override public boolean equals( Object other ) { if ( ! ( other instanceof TShortSet ) ) { return false; } TShortSet that = ( TShortSet ) other; if ( that.size() != this.size() ) { return false; } for ( int i = _states.length; i-- > 0; ) { if ( _states[i] == FULL ) { if ( ! that.contains( _set[i] ) ) { return false; } } } return true; }
private boolean setNextState(CacheLine line, State nextState) { if (line.nextState == nextState) return false; if (line.nextState == null || nextState == null || line.nextState.isLessThan(nextState)) { line.nextState = nextState; if (nextState == State.S | nextState == State.O) monitor.addMiss(); if (nextState == State.E) monitor.addInvalidate(line.sharers.size()); return true; } else return false; }
@Override public double compare(final SparseShortArray h1, final SparseShortArray h2) { short[] h1v = h1.values(); short[] h2v = h2.values(); TShortHashSet union = new TShortHashSet(h1v); union.addAll(h2v); if (h1v.length != h1.length || h2v.length != h2.length) union.add((short)0); TShortHashSet intersection = new TShortHashSet(h1v); intersection.retainAll(h2v); if (h1v.length != h1.length && h2v.length != h2.length) union.add((short)0); return 1.0 - (((double)intersection.size()) / (double)union.size()); } },
@Override public double compare(final SparseShortArray h1, final SparseShortArray h2) { short[] h1v = h1.values(); short[] h2v = h2.values(); TShortHashSet union = new TShortHashSet(h1v); union.addAll(h2v); if (h1v.length != h1.length || h2v.length != h2.length) union.add((short)0); TShortHashSet intersection = new TShortHashSet(h1v); intersection.retainAll(h2v); if (h1v.length != h1.length && h2v.length != h2.length) union.add((short)0); return 1.0 - (((double)intersection.size()) / (double)union.size()); } },
if (LOG.isDebugEnabled()) LOG.debug("Got ACK from {} to message {}", message.getNode(), entry.message); final int numNodes = entry.nodes.size(); if (done) { if (entry.message instanceof LineMessage) {