Esempio n. 1
0
 /// <summary>
 /// Helper for deducting the element and byte counts for a removed element.
 /// </summary>
 private Optional <E> Deduct(StableElement element)
 {
     if (element == null)
     {
         return(null);
     }
     _count.decrementAndGet();
     _bytes.addAndGet(-_sizeOf.apply(element.Element));
     return(element.Element);
 }
Esempio n. 2
0
            public override bool Equals(object o)
            {
                if (this == o)
                {
                    return(true);
                }
                if (o == null || this.GetType() != o.GetType())
                {
                    return(false);
                }
                //noinspection unchecked
                StableElement that = ( StableElement )o;

                return(SeqNo == that.SeqNo);
            }