php.java.bridge
Class ConstructorCache

java.lang.Object
  extended by php.java.bridge.ConstructorCache

final class ConstructorCache
extends java.lang.Object

Cache [Entry(method, parameters) -> Method]. No synchronization, so use this class per thread or per request only.


Nested Class Summary
static class ConstructorCache.Entry
          A cache entry
 
Field Summary
(package private)  java.util.Map map
           
(package private) static ConstructorCache.Entry noCache
           
 
Constructor Summary
ConstructorCache()
          Create a new ConstructorCache
 
Method Summary
 void clear()
          Removes all mappings from this cache.
 java.lang.reflect.Constructor get(ConstructorCache.Entry entry)
          Get the constructor for the entry
 ConstructorCache.Entry getEntry(java.lang.String name, java.lang.Object[] args)
          Get a cache entry from a name args pair
 void put(ConstructorCache.Entry entry, java.lang.reflect.Constructor method)
          Store a constructor with an entry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

java.util.Map map

noCache

static final ConstructorCache.Entry noCache
Constructor Detail

ConstructorCache

public ConstructorCache()
Create a new ConstructorCache

Method Detail

get

public java.lang.reflect.Constructor get(ConstructorCache.Entry entry)
Get the constructor for the entry

Parameters:
entry - The entry
Returns:
The constructor

put

public void put(ConstructorCache.Entry entry,
                java.lang.reflect.Constructor method)
Store a constructor with an entry

Parameters:
entry - The cache entry
method - The constructor

getEntry

public ConstructorCache.Entry getEntry(java.lang.String name,
                                       java.lang.Object[] args)
Get a cache entry from a name args pair

Parameters:
name - The constructor name
args - The arguments
Returns:
A cache entry.

clear

public void clear()
Removes all mappings from this cache.