Skip navigation links
oracle.javatools.util.deferred
Class THC
java.lang.Object
oracle.javatools.util.deferred.THC
-
public class THC
- extends java.lang.Object
An implementation of a typesafe heterogenous container, taken from effective java. See also http://kingsfleet.blogspot.com/2009/08/thc-and-bit-of-thunking-creative-ways.html
Nested Class Summary |
static interface |
THC.DeriveValue<T>
Allow the client to provide a derrived value |
Constructor Summary |
THC()
|
Method Summary |
|
as(java.lang.Class<Interface> type)
|
|
get(java.lang.Class<T> key)
|
|
put(java.lang.Class<T> key, T value)
|
|
put(java.lang.Class<T> key, THC.DeriveValue<T> value)
Place a value in the structure that has yet to be derrived. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
THC
public THC()
put
public <T> void put(java.lang.Class<T> key,
THC.DeriveValue<T> value)
- Place a value in the structure that has yet to be derrived.
-
- Parameters:
key
-
value
- The value to be thought of in the future
put
public <T> void put(java.lang.Class<T> key,
T value)
get
public <T> T get(java.lang.Class<T> key)
as
public <Interface> Interface as(java.lang.Class<Interface> type)
-
- Parameters:
type
- The type of the interface, all methods must have non parameters and non void return types
- Returns:
- A proxy that will return elements from the THC
Skip navigation links
Copyright © 1997, 2012, Oracle. All rights reserved.