Changeset 12464


Ignore:
Timestamp:
02/13/10 22:45:56 (5 years ago)
Author:
ehuelsmann
Message:

Convert LAYOUT and DIRECT-SUPERCLASSES of STANDARD-CLASS to slots.

Location:
branches/metaclass/abcl/src/org/armedbear/lisp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/metaclass/abcl/src/org/armedbear/lisp/LispClass.java

    r12462 r12464  
    123123    sxhash = hashCode() & 0x7fffffff;
    124124    setName(symbol);
    125     this.directSuperclasses = directSuperclasses;
     125    setDirectSuperclasses(directSuperclasses);
    126126  }
    127127
     
    131131    LispObject result = NIL;
    132132    result = result.push(new Cons("NAME", name != null ? name : NIL));
    133     result = result.push(new Cons("LAYOUT", classLayout != null ? classLayout : NIL));
    134     result = result.push(new Cons("DIRECT-SUPERCLASSES", directSuperclasses));
     133    result = result.push(new Cons("LAYOUT",
     134                                  getClassLayout() != null
     135                                  ? getClassLayout() : NIL));
     136    result = result.push(new Cons("DIRECT-SUPERCLASSES",
     137                                  getDirectSuperclasses()));
    135138    result = result.push(new Cons("DIRECT-SUBCLASSES", directSubclasses));
    136139    result = result.push(new Cons("CLASS-PRECEDENCE-LIST", classPrecedenceList));
     
    172175  }
    173176
    174   public final Layout getClassLayout()
     177  public Layout getClassLayout()
    175178  {
    176179    return classLayout;
    177180  }
    178181
    179   public final void setClassLayout(Layout layout)
     182  public void setClassLayout(Layout layout)
    180183  {
    181184    classLayout = layout;
     
    189192  }
    190193
    191   public final LispObject getDirectSuperclasses()
     194  public LispObject getDirectSuperclasses()
    192195  {
    193196    return directSuperclasses;
    194197  }
    195198
    196   public final void setDirectSuperclasses(LispObject directSuperclasses)
     199  public void setDirectSuperclasses(LispObject directSuperclasses)
    197200  {
    198201    this.directSuperclasses = directSuperclasses;
     
    212215  public final void setDirectSuperclass(LispObject superclass)
    213216  {
    214     directSuperclasses = new Cons(superclass);
     217    setDirectSuperclasses(new Cons(superclass));
    215218  }
    216219
  • branches/metaclass/abcl/src/org/armedbear/lisp/StandardClass.java

    r12463 r12464  
    3939{
    4040
    41   private static Symbol name = PACKAGE_MOP.intern("NAME");
     41  private static Symbol symName = PACKAGE_MOP.intern("NAME");
     42  private static Symbol symLayout = PACKAGE_MOP.intern("LAYOUT");
     43  private static Symbol symDirectSuperclasses
     44    = PACKAGE_MOP.intern("DIRECT-SUPERCLASSES");
    4245
    4346  static Layout layoutStandardClass =
    4447      new Layout(null,
    45                  list(name,
    46                       PACKAGE_MOP.intern("LAYOUT"),
    47                       PACKAGE_MOP.intern("DIRECT-SUPERCLASSES"),
     48                 list(symName,
     49                      symLayout,
     50                      symDirectSuperclasses,
    4851                      PACKAGE_MOP.intern("DIRECT-SUBCLASSES"),
    4952                      PACKAGE_MOP.intern("CLASS-PRECEDENCE-LIST"),
     
    7780  public LispObject getName()
    7881  {
    79     return getInstanceSlotValue(name);
     82    return getInstanceSlotValue(symName);
    8083  }
    8184
     
    8386  public void setName(LispObject newName)
    8487  {
    85     setInstanceSlotValue(name, newName);
    86   }
     88    setInstanceSlotValue(symName, newName);
     89  }
     90
     91  @Override
     92  public Layout getClassLayout()
     93  {
     94    LispObject layout = getInstanceSlotValue(symLayout);
     95    return (layout == UNBOUND_VALUE) ? null : (Layout)layout;
     96  }
     97
     98  @Override
     99  public void setClassLayout(Layout newLayout)
     100  {
     101    setInstanceSlotValue(symLayout, newLayout);
     102  }
     103
     104  @Override
     105  public LispObject getDirectSuperclasses()
     106  {
     107    return getInstanceSlotValue(symDirectSuperclasses);
     108  }
     109
     110  @Override
     111  public void setDirectSuperclasses(LispObject directSuperclasses)
     112  {
     113    setInstanceSlotValue(symDirectSuperclasses, directSuperclasses);
     114  }
     115
     116
    87117
    88118  @Override
Note: See TracChangeset for help on using the changeset viewer.