Top Description Inners Fields Constructors Methods
org.jooq.impl

pack-priv final Class ScopeStack<K, V>

extends Object
implements Iterable<V>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable
Imports
java.util.ArrayList, .Collections, .Iterator, .LinkedHashMap, .List, .Map, java.util.function.Function, .IntFunction, .Predicate, .Supplier, org.jooq.impl.AbstractContext.ScopeStackElement

A stack to register elements that are visible to a certain scope.
Author
Lukas Eder

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
pack-priv static record

Field Summary

Modifier and TypeField and Description
private final ObjIntFunction<K, V>
private int
private Map<K, List<V>>

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
ScopeStack(V defaultValue)

pack-priv
ScopeStack(ObjIntFunction<K, V> constructor)

Method Summary

Modifier and TypeMethod and Description
pack-priv final V
create(K key)

private final V
create0(K key, List<V> list)

pack-priv final V
get(K key)

private final V
get0(List<V> list)

pack-priv final V
getOrCreate(K key)

pack-priv final <T extends Throwable> V
getOrThrow(K key, Supplier<T> exception)

pack-priv final boolean
pack-priv final boolean
pack-priv final Iterable<V>
iterable(Predicate<? super V> filter)

pack-priv final Iterable<V>
public final Iterator<V>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.
private List<V>
list(K key)

private List<V>
listOrNull(K key)

pack-priv final void
pack-priv final int
pack-priv final void
pack-priv final void
set(K key, V value)

private void
set0(List<V> list, V value)

pack-priv final void
setAll(V value)

private final Map<K, List<V>>
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
private final void
trim()

pack-priv final Iterable<ScopeStack.Value<V>>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

constructorback to summary
private final ObjIntFunction<K, V> constructor
scopeLevelback to summary
private int scopeLevel
stackback to summary
private Map<K, List<V>> stack

Constructor Detail

ScopeStackback to summary
pack-priv ScopeStack()
ScopeStackback to summary
pack-priv ScopeStack(V defaultValue)
ScopeStackback to summary
pack-priv ScopeStack(ObjIntFunction<K, V> constructor)

Method Detail

createback to summary
pack-priv final V create(K key)
create0back to summary
private final V create0(K key, List<V> list)
getback to summary
pack-priv final V get(K key)
get0back to summary
private final V get0(List<V> list)
getOrCreateback to summary
pack-priv final V getOrCreate(K key)
getOrThrowback to summary
pack-priv final <T extends Throwable> V getOrThrow(K key, Supplier<T> exception) throws Supplier-:T
inScopeback to summary
pack-priv final boolean inScope()
isEmptyback to summary
pack-priv final boolean isEmpty()
iterableback to summary
pack-priv final Iterable<V> iterable(Predicate<? super V> filter)
iterableAtScopeLevelback to summary
pack-priv final Iterable<V> iterableAtScopeLevel()
iteratorback to summary
public final Iterator<V> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<V>

an Iterator.

Annotations
@Override
listback to summary
private List<V> list(K key)
listOrNullback to summary
private List<V> listOrNull(K key)
scopeEndback to summary
pack-priv final void scopeEnd()
scopeLevelback to summary
pack-priv final int scopeLevel()
scopeStartback to summary
pack-priv final void scopeStart()
setback to summary
pack-priv final void set(K key, V value)
set0back to summary
private void set0(List<V> list, V value)
setAllback to summary
pack-priv final void setAll(V value)
stackback to summary
private final Map<K, List<V>> stack()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
trimback to summary
private final void trim()
valueIterableback to summary
pack-priv final Iterable<ScopeStack.Value<V>> valueIterable()
org.jooq.impl back to summary

private final Class ScopeStack.ScopeStackIterator<U>

extends Object
implements Iterator<U>
Class Inheritance
All Implemented Interfaces
java.util.Iterator

Field Summary

Modifier and TypeField and Description
pack-priv final Predicate<? super U>
pack-priv final Iterator<List<V>>
pack-priv U
pack-priv final Function<List<V>, U>

Constructor Summary

AccessConstructor and Description
pack-priv
ScopeStackIterator(Function<List<V>, U> valueExtractor, Predicate<? super U> filter)

Method Summary

Modifier and TypeMethod and Description
public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.
private U
move()

public U
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.
public void
remove()

Overrides default java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation).
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

filterback to summary
pack-priv final Predicate<? super U> filter
itback to summary
pack-priv final Iterator<List<V>> it
nextback to summary
pack-priv U next
valueExtractorback to summary
pack-priv final Function<List<V>, U> valueExtractor

Constructor Detail

ScopeStackIteratorback to summary
pack-priv ScopeStackIterator(Function<List<V>, U> valueExtractor, Predicate<? super U> filter)

Method Detail

hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

Annotations
@Override
moveback to summary
private U move()
nextback to summary
public U next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:U

the next element in the iteration

Annotations
@Override
removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Doc from java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to next.

The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.

The behavior of an iterator is unspecified if this method is called after a call to the forEachRemaining method.

Annotations
@Override
org.jooq.impl back to summary

pack-priv final Record ScopeStack.Value<V>

extends Record
Class Inheritance
Record Components
scopeLevel:int 
value:V 

Field Summary

Modifier and TypeField and Description
private final int
scopeLevel

Record Component accessed by scopeLevel().

private final V
value

Record Component accessed by value().

Constructor Summary

AccessConstructor and Description
pack-priv
Value(int scopeLevel, V value)

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object
the reference object with which to compare.
o
)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.
public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.
pack-priv static <V> ScopeStack.Value<V>
lastOf(List<V> list)

pack-priv static <V> ScopeStack.Value<V>
of(int scopeLevel, V value)

public int
scopeLevel()

Record Component getter of scopeLevel.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.
public V
value()

Record Component getter of value.

Field Detail

scopeLevelback to summary
private final int scopeLevel

Record Component accessed by scopeLevel().

valueback to summary
private final V value

Record Component accessed by value().

Constructor Detail

Valueback to summary
pack-priv Value(int scopeLevel, V value)

Method Detail

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this record is equal to the argument; false otherwise.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

Returns:int

a hash code value for this record.

lastOfback to summary
pack-priv static <V> ScopeStack.Value<V> lastOf(List<V> list)
ofback to summary
pack-priv static <V> ScopeStack.Value<V> of(int scopeLevel, V value)
scopeLevelback to summary
public int scopeLevel()

Record Component getter of scopeLevel.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

Returns:String

a string representation of the object.

valueback to summary
public V value()

Record Component getter of value.