Changeset 4218


Ignore:
Timestamp:
10/06/03 13:51:18 (19 years ago)
Author:
piso
Message:

Work in progress.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/j/JVar.java

    r3906 r4218  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: JVar.java,v 1.2 2003-09-19 17:42:09 piso Exp $
     5 * $Id: JVar.java,v 1.3 2003-10-06 13:51:18 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    3030public final class JVar extends LispObject
    3131{
    32     private static final ArrayList variables = new ArrayList();
    33 
    3432    private static final Symbol J_VARIABLE_VALUE =
    3533        LispAPI.PACKAGE_J_INTERNALS.addInternalSymbol("J-VARIABLE-VALUE");
    3634
    37     private Property property;
     35    private final Property property;
    3836
    3937    private JVar(String name, Property property)
     
    5957    {
    6058        LispObject obj = get(symbol, J_VARIABLE_VALUE, null);
    61         if (!(obj instanceof JVar))
    62             throw new ConditionThrowable(new LispError(String.valueOf(symbol) +
    63                                                        " is not defined as an editor variable"));
    64         return (JVar) obj;
     59        if (obj instanceof JVar)
     60            return (JVar) obj;
     61        throw new ConditionThrowable(new LispError(String.valueOf(symbol) +
     62            " is not defined as an editor variable"));
    6563    }
    6664
    67     public static void addVariableForProperty(Property property)
     65    public static synchronized void addVariableForProperty(Property property)
    6866    {
    69         variables.add(new JVar(property.getLispName(), property));
     67        new JVar(property.getLispName(), property);
     68    }
     69
     70    public String toString()
     71    {
     72        FastStringBuffer sb = new FastStringBuffer("#<J-VARIABLE @ #x");
     73        sb.append(Integer.toHexString(hashCode()));
     74        sb.append(">");
     75        return sb.toString();
    7076    }
    7177}
Note: See TracChangeset for help on using the changeset viewer.