edu.neu.ccs.demeterf.dispatch
Class MethodDB<M>

java.lang.Object
  extended by edu.neu.ccs.demeterf.dispatch.MethodDB<M>

public class MethodDB<M>
extends java.lang.Object

MethodDB is a List of DBEntries. Includes selection functions and a few creators.


Constructor Summary
MethodDB(List<DBEntry<M>> m)
           
 
Method Summary
 List<DBEntry<M>> allMethods()
           
static MethodDB<java.lang.reflect.Constructor<?>> createConstrDB(java.lang.Class<?> c)
           
static MethodDB<java.lang.reflect.Method> createMethodDB(java.lang.Class<?> c, java.lang.String name)
           
static List<DBEntry<java.lang.reflect.Method>> getMethods(java.lang.Class<?> c, java.lang.String name)
           
static boolean isDebug()
           
 List<DBEntry<M>> matchAllEntries(java.lang.Class<?>[] args)
          Match All the entries that are applicable
 DBEntry<M> matchEntryFast(java.lang.Class<?>[] args)
          !Quickly! return the most specific (first) Match from the entries.
 List<DBEntry<M>> prefixApp(java.lang.Class<?> c)
          Filter the DBEntries based on the number of arguments and the type of the first argument.
static void setDebug(boolean b)
           
 java.lang.String toString()
          Normal toString()
 java.lang.String toString(java.lang.String s)
          Return a String representation of this MethodDB with s in between the method entries
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MethodDB

public MethodDB(List<DBEntry<M>> m)
Method Detail

getMethods

public static List<DBEntry<java.lang.reflect.Method>> getMethods(java.lang.Class<?> c,
                                                                 java.lang.String name)

createMethodDB

public static MethodDB<java.lang.reflect.Method> createMethodDB(java.lang.Class<?> c,
                                                                java.lang.String name)

createConstrDB

public static MethodDB<java.lang.reflect.Constructor<?>> createConstrDB(java.lang.Class<?> c)

setDebug

public static void setDebug(boolean b)

isDebug

public static boolean isDebug()

matchEntryFast

public DBEntry<M> matchEntryFast(java.lang.Class<?>[] args)
!Quickly! return the most specific (first) Match from the entries. Returns null if none is found.


matchAllEntries

public List<DBEntry<M>> matchAllEntries(java.lang.Class<?>[] args)
Match All the entries that are applicable


toString

public java.lang.String toString()
Normal toString()

Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.lang.String s)
Return a String representation of this MethodDB with s in between the method entries


prefixApp

public List<DBEntry<M>> prefixApp(java.lang.Class<?> c)
Filter the DBEntries based on the number of arguments and the type of the first argument. Greater than one means that they place a constraint on the traversal of an instance of "c" (if applicable)


allMethods

public List<DBEntry<M>> allMethods()