/** * Creates a copy of this reference for the given entry. * * <p>{@code value} may be null only for a loading reference. */ ValueReference<K, V> copyFor( ReferenceQueue<V> queue, @Nullable V value, ReferenceEntry<K, V> entry);
/** * Notify pending loads that a new value was set. This is only relevant to loading value * references. */ void notifyNewValue(@Nullable V newValue);
@Override public ValueReference<K, V> copyFor( ReferenceQueue<V> queue, @Nullable V value, ReferenceEntry<K, V> entry) { return this; } }
/** * Returns the value of the edge that connects {@code nodeU} to {@code nodeV}, if one is present; * otherwise, returns {@code defaultValue}. * * <p>In an undirected graph, this is equal to {@code edgeValueOrDefault(nodeV, nodeU, * defaultValue)}. * * @throws IllegalArgumentException if {@code nodeU} or {@code nodeV} is not an element of this * graph */ @Nullable V edgeValueOrDefault(N nodeU, N nodeV, @Nullable V defaultValue);
/** Listeners also form a stack through the {@link #listeners} field. */ private static final class Listener { static final Listener TOMBSTONE = new Listener(null, null); final Runnable task; final Executor executor; // writes to next are made visible by subsequent CAS's on the listeners field @Nullable Listener next; Listener(Runnable task, Executor executor) { this.task = task; this.executor = executor; } }
/** * Two ordered {@link EndpointPair}s are equal if their {@link #source()} and {@link #target()} * are equal. Two unordered {@link EndpointPair}s are equal if they contain the same nodes. An * ordered {@link EndpointPair} is never equal to an unordered {@link EndpointPair}. */ @Override public abstract boolean equals(@Nullable Object obj);
/** * Creates a new iterator with the given first element, or, if {@code firstOrNull} is null, * creates a new empty iterator. */ protected AbstractSequentialIterator(@Nullable T firstOrNull) { this.nextOrNull = firstOrNull; }
@Override public boolean contains(@Nullable Object target) { // Overridden to prevent a ton of boxing return (target instanceof Short) && Shorts.indexOf(array, (Short) target, start, end) != -1; }
@Override public int lastIndexOf(@Nullable Object target) { // Overridden to prevent a ton of boxing if (target instanceof Short) { int i = Shorts.lastIndexOf(array, (Short) target, start, end); if (i >= 0) { return i - start; } } return -1; }
/** * Indicates whether another object is equal to this predicate. * * <p>Most implementations will have no reason to override the behavior of {@link Object#equals}. * However, an implementation may also choose to return {@code true} whenever {@code object} is a * {@link Predicate} that it considers <i>interchangeable</i> with this one. "Interchangeable" * <i>typically</i> means that {@code this.apply(t) == that.apply(t)} for all {@code t} of type * {@code T}). Note that a {@code false} result from this method does not imply that the * predicates are known <i>not</i> to be interchangeable. */ @Override boolean equals(@Nullable Object object);
/** * Determines whether this multiset contains the specified element. * * <p>This method refines {@link Collection#contains} to further specify that it <b>may not</b> * throw an exception in response to {@code element} being null or of the wrong type. * * @param element the element to check for * @return {@code true} if this multiset contains at least one occurrence of the element */ @Override boolean contains(@Nullable Object element);
/** * Returns {@code true} if {@code obj} is another {@code RangeMap} that has an equivalent {@link * #asMapOfRanges()}. */ @Override boolean equals(@Nullable Object o);
@Override public V setValue(@Nullable V newValue) { V result = value; this.value = newValue; return result; } }
@Override public boolean equals(@Nullable Object object) { if (object instanceof Murmur3_128HashFunction) { Murmur3_128HashFunction other = (Murmur3_128HashFunction) object; return seed == other.seed; } return false; }
/** * Returns a view collection of the values associated with {@code key} in this multimap, if any. * Note that when {@code containsKey(key)} is false, this returns an empty collection, not {@code * null}. * * <p>Changes to the returned collection will update the underlying multimap, and vice versa. */ Collection<V> get(@Nullable K key);
/** Creates a {@code Callable} which immediately returns a preset value each time it is called. */ public static <T> Callable<T> returning(final @Nullable T value) { return new Callable<T>() { @Override public T call() { return value; } }; }
/** * Constructs a {@code VerifyException} with the cause {@code cause} and a message that is {@code * null} if {@code cause} is null, and {@code cause.toString()} otherwise. * * @since 19.0 */ public VerifyException(@Nullable Throwable cause) { super(cause); }
@Override public boolean equals(@Nullable Object obj) { if (obj instanceof FreshInvocationHandler) { FreshInvocationHandler that = (FreshInvocationHandler) obj; return identity == that.identity; } return false; }