Changeset 3621
- Timestamp:
- 09/08/03 15:19:29 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/Type.java
r3353 r3621 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: Type.java,v 1.1 5 2003-08-12 15:22:57piso Exp $5 * $Id: Type.java,v 1.16 2003-09-08 15:19:29 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 29 29 private static final HashMap map = new HashMap(); 30 30 31 private final ArrayList super Types = new ArrayList();31 private final ArrayList supertypes = new ArrayList(); 32 32 33 33 private final Symbol symbol; … … 41 41 } 42 42 43 private Type(Symbol symbol, Type super Type)43 private Type(Symbol symbol, Type supertype) 44 44 { 45 45 this.symbol = symbol; … … 47 47 map.put(symbol, this); 48 48 } 49 synchronized (super Types) {50 super Types.add(superType);51 } 52 } 53 54 private Type(Symbol symbol, Type super Type1, Type superType2)49 synchronized (supertypes) { 50 supertypes.add(supertype); 51 } 52 } 53 54 private Type(Symbol symbol, Type supertype1, Type supertype2) 55 55 { 56 56 this.symbol = symbol; … … 58 58 map.put(symbol, this); 59 59 } 60 synchronized (superTypes) { 61 superTypes.add(superType1); 62 superTypes.add(superType2); 60 synchronized (supertypes) { 61 supertypes.add(supertype1); 62 supertypes.add(supertype2); 63 } 64 } 65 66 private void addSupertype(Type supertype) 67 { 68 synchronized (supertypes) { 69 supertypes.add(supertype); 63 70 } 64 71 } … … 107 114 if (otherType == this) 108 115 return true; 109 for (int i = 0; i < super Types.size(); i++) {110 if (super Types.get(i) == otherType)116 for (int i = 0; i < supertypes.size(); i++) { 117 if (supertypes.get(i) == otherType) 111 118 return true; 112 119 } 113 for (int i = 0; i < super Types.size(); i++) {114 Type super Type = (Type) superTypes.get(i);115 if (super Type._isSubtypeOf(otherType))120 for (int i = 0; i < supertypes.size(); i++) { 121 Type supertype = (Type) supertypes.get(i); 122 if (supertype._isSubtypeOf(otherType)) 116 123 return true; 117 124 } … … 172 179 public static final Type STANDARD_CHAR = 173 180 new Type(Symbol.STANDARD_CHAR, BASE_CHAR); 181 182 static { 183 CHARACTER.addSupertype(BASE_CHAR); 184 } 174 185 175 186 // Subtypes of NUMBER
Note: See TracChangeset
for help on using the changeset viewer.