abc.weaving.aspectinfo
Class ArgAny

java.lang.Object
  extended by abc.weaving.aspectinfo.Syntax
      extended by abc.weaving.aspectinfo.ArgPattern
          extended by abc.weaving.aspectinfo.ArgAny
Direct Known Subclasses:
ArgType, ArgVar

public class ArgAny
extends ArgPattern

An argument pattern denoting any type.

Author:
Aske Simon Christensen, Ganesh Sittampalam, Damien Sereni

Constructor Summary
ArgAny(Position pos)
           
 
Method Summary
 void getFreeVars(java.util.Set result)
           
 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

ArgAny

public ArgAny(Position pos)
Method Detail

matchesAt

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

Specified by:
matchesAt in class ArgPattern

toString

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

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

Specified by:
substituteForPointcutFormal in class ArgPattern

getFreeVars

public void getFreeVars(java.util.Set result)
Specified by:
getFreeVars in class ArgPattern

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).

Specified by:
unify in class ArgPattern
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.