T
- value typepublic class NestedCache<T> extends Object
Map
s.
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Constructor and Description |
---|
NestedCache(Class<?>... types)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
NestedCache<T> |
getChild(Object key)
Return branch for key.
|
Set<Object> |
getKeys()
Return set of key objects on this level.
|
T |
getValue(Object key)
Return value for key.
|
T |
getValue(Supplier<T> supplier,
Object... keys)
Returns a value.
|
String |
toString() |
public NestedCache(Class<?>... types)
types
- Class<?>...; typespublic T getValue(Supplier<T> supplier, Object... keys)
supplier
- Supplier<T>; supplier of T
for if it wasn't cached yetkeys
- Object...; list of key objectspublic Set<Object> getKeys()
public NestedCache<T> getChild(Object key) throws IllegalStateException
key
- Object; keyIllegalStateException
- if this is not a branch levelpublic T getValue(Object key) throws IllegalStateException
key
- Object; keyIllegalStateException
- if this is not a leaf levelCopyright © 2014–2019 Delft University of Technology. All rights reserved.