1 21 22 package org.armedbear.lisp; 23 24 public final class FileError extends LispError 25 { 26 private LispObject pathname = NIL; 27 28 public FileError(LispObject initArgs) throws ConditionThrowable 30 { 31 super(initArgs); 32 if (initArgs instanceof Cons) { 33 LispObject pathname = NIL; 34 LispObject first, second; 35 while (initArgs != NIL) { 36 first = initArgs.car(); 37 initArgs = initArgs.cdr(); 38 second = initArgs.car(); 39 initArgs = initArgs.cdr(); 40 if (first == Keyword.PATHNAME) { 41 pathname = second; 42 break; 43 } 44 } 45 this.pathname = pathname; 46 } else 47 pathname = initArgs; 48 } 49 50 public FileError(String message) 51 { 52 super(message); 53 } 54 55 public FileError(String message, LispObject pathname) 56 { 57 super(message); 58 this.pathname = pathname; 59 } 60 61 public LispObject getPathname() 62 { 63 return pathname; 64 } 65 66 public LispObject typeOf() 67 { 68 return Symbol.FILE_ERROR; 69 } 70 71 public LispClass classOf() 72 { 73 return BuiltInClass.FILE_ERROR; 74 } 75 76 public LispObject typep(LispObject type) throws ConditionThrowable 77 { 78 if (type == Symbol.FILE_ERROR) 79 return T; 80 if (type == BuiltInClass.FILE_ERROR) 81 return T; 82 return super.typep(type); 83 } 84 } 85 | Popular Tags |