public void print() { long[] t = _t; System.out.print("[sum="+_sum_cache+","+t[0]); for( int i=1; i<t.length; i++ ) System.out.print(","+t[i]); System.out.print("]"); if( _next != null ) _next.print(); } }
private final static boolean CAS( long[] A, int idx, long old, long nnn ) { return _unsafe.compareAndSwapLong( A, rawIndex(A,idx), old, nnn ); }
String toString( long mask ) { return Long.toString(sum(mask)); }
boolean ok = CAS(t, idx, old & ~mask, old + x); if (_sum_cache != Long.MIN_VALUE) _sum_cache = Long.MIN_VALUE; // Blow out cache if (ok) return old; // Got it old = t[idx]; if ((old & mask) != 0) return old; // Failed for bit-set under mask if (CAS(t, idx, old, old + x)) break; // Got it! cnt++; CAT newcat = new CAT(this, t.length * 2, 0);
String toString( long mask ) { return Long.toString(sum(mask)); }
private long add_if_mask( long x, long mask ) { return _cat.add_if_mask(x,mask,hash(),this); }
private long add_if_mask( long x, long mask ) { return _cat.add_if_mask(x,mask,hash(),this); }
String toString( long mask ) { return Long.toString(sum(mask)); }
/** Same as {@link #get}, included for completeness. */ public long longValue() { return _cat.sum(0); }
/** Same as {@link #get}, included for completeness. */ public long longValue() { return _cat.sum(0); }
/** Same as {@link #get}, included for completeness. */ public long longValue() { return _cat.sum(0); }
/** Same as {@link #get}, included for completeness. */ public int intValue() { return (int)_cat.sum(0); } /** Same as {@link #get}, included for completeness. */
private final static boolean CAS(long[] A, int idx, long old, long nnn) { return _unsafe.compareAndSwapLong(A, rawIndex(A, idx), old, nnn); }
private long add_if_mask(long x, long mask) { return _cat.add_if_mask(x, mask, hash(), this); }
String toString(long mask) { return Long.toString(sum(mask)); }
/** Same as {@link #get}, included for completeness. */ public int intValue() { return (int)_cat.sum(0); } /** Same as {@link #get}, included for completeness. */
private long add_if_mask( long x, long mask ) { return _cat.add_if_mask(x,mask,hash(),this); }