gnu.kawa.reflect
Class SlotGet

java.lang.Object
  extended by gnu.mapping.Procedure
      extended by gnu.mapping.Procedure2
          extended by gnu.kawa.reflect.SlotGet
All Implemented Interfaces:
CanInline, Inlineable, HasSetter, Named

public class SlotGet
extends Procedure2
implements HasSetter, CanInline, Inlineable


Field Summary
static SlotGet field
           
static SlotGet staticField
           
 
Constructor Summary
SlotGet(java.lang.String name, boolean isStatic)
           
SlotGet(java.lang.String name, boolean isStatic, Procedure setter)
           
 
Method Summary
 java.lang.Object apply2(java.lang.Object obj, java.lang.Object name)
           
 void compile(ApplyExp exp, Compilation comp, Target target)
           
static java.lang.Object field(java.lang.Object obj, java.lang.String fname)
           
 Type getReturnType(Expression[] args)
           
 Procedure getSetter()
           
 Expression inline(ApplyExp exp, ExpWalker walker)
          Inline an application of this Procedure and return result.
static Expression makeGetField(Expression value, java.lang.String fieldName)
          Convenience method to make an Expression that gets the value of a field.
 void set2(java.lang.Object obj, java.lang.Object name, java.lang.Object value)
           
 void setN(java.lang.Object[] args)
           
static java.lang.Object staticField(java.lang.Object obj, java.lang.String fname)
           
 
Methods inherited from class gnu.mapping.Procedure2
apply0, apply1, apply3, apply4, applyN, numArgs
 
Methods inherited from class gnu.mapping.Procedure
apply, apply, check0, check1, check2, check3, check4, checkArgCount, checkN, getName, getProperty, getSymbol, match0, match1, match2, match3, match4, matchN, maxArgs, minArgs, name, removeProperty, set0, set1, setName, setProperty, setProperty, setSetter, setSymbol, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

field

public static final SlotGet field

staticField

public static final SlotGet staticField
Constructor Detail

SlotGet

public SlotGet(java.lang.String name,
               boolean isStatic)

SlotGet

public SlotGet(java.lang.String name,
               boolean isStatic,
               Procedure setter)
Method Detail

field

public static java.lang.Object field(java.lang.Object obj,
                                     java.lang.String fname)

staticField

public static java.lang.Object staticField(java.lang.Object obj,
                                           java.lang.String fname)

apply2

public java.lang.Object apply2(java.lang.Object obj,
                               java.lang.Object name)
Specified by:
apply2 in class Procedure2

setN

public void setN(java.lang.Object[] args)
Overrides:
setN in class Procedure

set2

public void set2(java.lang.Object obj,
                 java.lang.Object name,
                 java.lang.Object value)

inline

public Expression inline(ApplyExp exp,
                         ExpWalker walker)
Description copied from interface: CanInline
Inline an application of this Procedure and return result. Can return original expression.

Specified by:
inline in interface CanInline

compile

public void compile(ApplyExp exp,
                    Compilation comp,
                    Target target)
Specified by:
compile in interface Inlineable

getReturnType

public Type getReturnType(Expression[] args)
Specified by:
getReturnType in interface Inlineable

getSetter

public Procedure getSetter()
Specified by:
getSetter in interface HasSetter
Overrides:
getSetter in class Procedure

makeGetField

public static Expression makeGetField(Expression value,
                                      java.lang.String fieldName)
Convenience method to make an Expression that gets the value of a field.

Parameters:
value - evaluates to object that has the named field
fieldName - name of field in value
Returns:
expression that get the name field from value