/** * Adds an element if the element at the given index is null. Returns true if no element existed at the given index, * else returns false and doesn't set the element. * @param seqno * @param element * @return True if the element at the computed index was null, else false */ public boolean add(long seqno, T element) { lock.lock(); try { return _add(seqno, element, true, null); } finally { lock.unlock(); } }
/** * Adds an element if the element at the given index is null. Returns true if no element existed at the given index, * else returns false and doesn't set the element. * @param seqno * @param element * @param remove_filter If not null, a filter used to remove all consecutive messages passing the filter * @return True if the element at the computed index was null, else false */ public boolean add(long seqno, T element, Predicate<T> remove_filter) { lock.lock(); try { return _add(seqno, element, true, remove_filter); } finally { lock.unlock(); } }
long seqno=tuple.getVal1(); T element=const_value != null? const_value : tuple.getVal2(); if(_add(seqno, element, false, null)) added=true; else if(remove_added_elements)
/** * Adds an element if the element at the given index is null. Returns true if no element existed at the given index, * else returns false and doesn't set the element. * @param seqno * @param element * @param remove_filter If not null, a filter used to remove all consecutive messages passing the filter * @return True if the element at the computed index was null, else false */ public boolean add(long seqno, T element, Predicate<T> remove_filter) { lock.lock(); try { return _add(seqno, element, true, remove_filter); } finally { lock.unlock(); } }
/** * Adds an element if the element at the given index is null. Returns true if no element existed at the given index, * else returns false and doesn't set the element. * @param seqno * @param element * @return True if the element at the computed index was null, else false */ public boolean add(long seqno, T element) { lock.lock(); try { return _add(seqno, element, true, null); } finally { lock.unlock(); } }
long seqno=tuple.getVal1(); T element=const_value != null? const_value : tuple.getVal2(); if(_add(seqno, element, false, null)) added=true; else if(remove_added_elements)