Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

oracle.javatools.util.deferred
Class THC

java.lang.Object
  extended by 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
<Interface>
Interface
as(java.lang.Class<Interface> type)
           
<T> T
get(java.lang.Class<T> key)
           
<T> void
put(java.lang.Class<T> key, T value)
           
<T> void
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
 

Constructor Detail

THC

public THC()
Method Detail

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

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

Copyright © 1997, 2011, Oracle. All rights reserved.