abc.weaving.aspectinfo
Class ArgVar

java.lang.Object
  extended by abc.weaving.aspectinfo.Syntax
      extended by abc.weaving.aspectinfo.ArgPattern
          extended by abc.weaving.aspectinfo.ArgAny
              extended by abc.weaving.aspectinfo.ArgVar

public class ArgVar
extends ArgAny

An argument pattern denoting a pointcut variable.

Author:
Aske Simon Christensen, Ganesh Sittampalam, Damien Sereni

Constructor Summary
ArgVar(Var var, Position pos)
           
 
Method Summary
 void getFreeVars(java.util.Set result)
           
 Var getVar()
           
 Residue matchesAt(WeavingEnv we, ContextValue cv)
          For use when being used in an args pattern
 Var substituteForPointcutFormal(java.util.Hashtable renameEnv, java.util.Hashtable typeEnv, Formal formal, java.util.List newLocals, java.util.List newCasts, Position pos)
          For use when this is being used as a pointcut formal
 java.lang.String toString()
           
 boolean unify(ArgPattern other, Unification unification)
          Attempts to unify two pointcuts, creating another pointcut that has enough variables to encompass both if possible.
 
Methods inherited from class abc.weaving.aspectinfo.Syntax
getPosition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArgVar

public ArgVar(Var var,
              Position pos)
Method Detail

getVar

public Var getVar()

toString

public java.lang.String toString()
Overrides:
toString in class ArgAny

matchesAt

public Residue matchesAt(WeavingEnv we,
                         ContextValue cv)
Description copied from class: ArgPattern
For use when being used in an args pattern

Overrides:
matchesAt in class ArgAny

substituteForPointcutFormal

public Var substituteForPointcutFormal(java.util.Hashtable renameEnv,
                                       java.util.Hashtable typeEnv,
                                       Formal formal,
                                       java.util.List newLocals,
                                       java.util.List newCasts,
                                       Position pos)
Description copied from class: ArgPattern
For use when this is being used as a pointcut formal

Overrides:
substituteForPointcutFormal in class ArgAny

getFreeVars

public void getFreeVars(java.util.Set result)
Overrides:
getFreeVars in class ArgAny

unify

public boolean unify(ArgPattern other,
                     Unification unification)
Description copied from class: ArgPattern
Attempts to unify two pointcuts, creating another pointcut that has enough variables to encompass both if possible. Variables are only unified if they have the same type, as stored in the unification typemaps. If unification.unifyWithFirst(), then restricted unification is attempted, which succeeds only if both pointcuts can be unified with result the first pointcut (ie the first pointcut has no less free variables than the second).

Overrides:
unify in class ArgAny
Parameters:
other - The other pointcut to unify with
unification - The unification. This should be initialized (determining whether we attempt proper or restricted unification) and the typemaps should be set.
Returns:
True iff the unification was successful. In this case, unification contains the resulting pointcut and the substitutions taking it to THIS and OTHER. Otherwise, unification is left in any old state.