Add @Override annotations.

Patch by: Douglas Miles
parent c5701e4e
......@@ -35,6 +35,7 @@ package org.armedbear.lisp;
public abstract class AbstractArray extends LispObject
{
@Override
public LispObject typep(LispObject type) throws ConditionThrowable
{
if (type == Symbol.ARRAY)
......@@ -44,6 +45,7 @@ public abstract class AbstractArray extends LispObject
return super.typep(type);
}
@Override
public boolean equalp(LispObject obj) throws ConditionThrowable
{
if (obj instanceof AbstractArray) {
......@@ -99,6 +101,7 @@ public abstract class AbstractArray extends LispObject
public abstract int getTotalSize();
@Override
public abstract void aset(int index, LispObject newValue)
throws ConditionThrowable;
......@@ -281,6 +284,7 @@ public abstract class AbstractArray extends LispObject
}
// For EQUALP hash tables.
@Override
public int psxhash()
{
try {
......
......@@ -42,6 +42,7 @@ public abstract class AbstractBitVector extends AbstractVector
// For non-displaced bit-vectors.
protected long[] bits;
@Override
public LispObject typep(LispObject type) throws ConditionThrowable
{
if (type == Symbol.BIT_VECTOR)
......@@ -51,21 +52,25 @@ public abstract class AbstractBitVector extends AbstractVector
return super.typep(type);
}
@Override
public LispObject classOf()
{
return BuiltInClass.BIT_VECTOR;
}
@Override
public final int capacity()
{
return capacity;
}
@Override
public final LispObject getElementType()
{
return Symbol.BIT;
}
@Override
public boolean equal(LispObject obj) throws ConditionThrowable
{
if (this == obj)
......@@ -83,6 +88,7 @@ public abstract class AbstractBitVector extends AbstractVector
return false;
}
@Override
public boolean equalp(LispObject obj) throws ConditionThrowable
{
if (this == obj)
......@@ -104,6 +110,7 @@ public abstract class AbstractBitVector extends AbstractVector
return false;
}
@Override
public void fill(LispObject obj) throws ConditionThrowable
{
try {
......@@ -134,6 +141,7 @@ public abstract class AbstractBitVector extends AbstractVector
error(new TypeError(obj, Symbol.BIT));
}
@Override
public LispObject subseq(int start, int end) throws ConditionThrowable
{
SimpleBitVector v = new SimpleBitVector(end - start);
......@@ -152,6 +160,7 @@ public abstract class AbstractBitVector extends AbstractVector
}
}
@Override
public int hashCode()
{
int hashCode = 1;
......@@ -168,6 +177,7 @@ public abstract class AbstractBitVector extends AbstractVector
return hashCode;
}
@Override
public String writeToString() throws ConditionThrowable
{
final LispThread thread = LispThread.currentThread();
......@@ -192,6 +202,7 @@ public abstract class AbstractBitVector extends AbstractVector
}
// Ignores fill pointer.
@Override
public LispObject AREF(LispObject index) throws ConditionThrowable
{
try {
......@@ -202,6 +213,7 @@ public abstract class AbstractBitVector extends AbstractVector
}
}
@Override
public LispObject reverse() throws ConditionThrowable
{
int length = length();
......
......@@ -35,6 +35,7 @@ package org.armedbear.lisp;
public abstract class AbstractString extends AbstractVector
{
@Override
public LispObject typep(LispObject type) throws ConditionThrowable
{
if (type instanceof Symbol) {
......@@ -50,26 +51,31 @@ public abstract class AbstractString extends AbstractVector
return super.typep(type);
}
@Override
public final LispObject STRINGP()
{
return T;
}
@Override
public final boolean stringp()
{
return true;
}
@Override
public LispObject getElementType()
{
return Symbol.CHARACTER;
}
@Override
public final boolean isSimpleVector()
{
return false;
}
@Override
public final LispObject STRING()
{
return this;
......@@ -107,6 +113,7 @@ public abstract class AbstractString extends AbstractVector
return getStringValue().substring(beginIndex, endIndex);
}
@Override
public String writeToString() throws ConditionThrowable
{
return writeToString(0, length());
......
......@@ -34,6 +34,7 @@ package org.armedbear.lisp;
public abstract class AbstractVector extends AbstractArray
{
@Override
public LispObject typep(LispObject type) throws ConditionThrowable
{
if (type == Symbol.VECTOR)
......@@ -47,16 +48,19 @@ public abstract class AbstractVector extends AbstractArray
return super.typep(type);
}
@Override
public final LispObject VECTORP()
{
return T;
}
@Override
public final boolean vectorp()
{
return true;
}
@Override
public boolean equalp(LispObject obj) throws ConditionThrowable
{
if (obj instanceof AbstractVector)
......@@ -72,16 +76,19 @@ public abstract class AbstractVector extends AbstractArray
return false;
}
@Override
public final int getRank()
{
return 1;
}
@Override
public final LispObject getDimensions()
{
return new Cons(new Fixnum(capacity()));
}
@Override
public final int getDimension(int n) throws ConditionThrowable
{
if (n != 0)
......@@ -93,6 +100,7 @@ public abstract class AbstractVector extends AbstractArray
return capacity();
}
@Override
public final int getTotalSize()
{
return capacity();
......@@ -180,8 +188,10 @@ public abstract class AbstractVector extends AbstractArray
return false;
}
@Override
public abstract LispObject reverse() throws ConditionThrowable;
@Override
public LispObject nreverse() throws ConditionThrowable
{
int i = 0;
......@@ -197,6 +207,7 @@ public abstract class AbstractVector extends AbstractArray
return this;
}
@Override
public String writeToString() throws ConditionThrowable
{
final LispThread thread = LispThread.currentThread();
......@@ -266,6 +277,7 @@ public abstract class AbstractVector extends AbstractArray
}
// For EQUALP hash tables.
@Override
public int psxhash()
{
try
......
......@@ -46,6 +46,7 @@ public class ArithmeticError extends LispError
initialize(initArgs);
}
@Override
protected void initialize(LispObject initArgs) throws ConditionThrowable
{
super.initialize(initArgs);
......@@ -75,16 +76,19 @@ public class ArithmeticError extends LispError
setOperands(NIL);
}
@Override
public LispObject typeOf()
{
return Symbol.ARITHMETIC_ERROR;
}
@Override
public LispObject classOf()
{
return StandardClass.ARITHMETIC_ERROR;
}
@Override
public LispObject typep(LispObject type) throws ConditionThrowable
{
if (type == Symbol.ARITHMETIC_ERROR)
......@@ -120,6 +124,7 @@ public class ArithmeticError extends LispError
private static final Primitive ARITHMETIC_ERROR_OPERATION =
new Primitive("arithmetic-error-operation", "condition")
{
@Override
public LispObject execute(LispObject arg) throws ConditionThrowable
{
try {
......@@ -134,6 +139,7 @@ public class ArithmeticError extends LispError
private static final Primitive ARITHMETIC_ERROR_OPERANDS =
new Primitive("arithmetic-error-operands", "condition")
{
@Override
public LispObject execute(LispObject arg) throws ConditionThrowable
{
try {
......
......@@ -152,18 +152,21 @@ public class Autoload extends Function
return symbol.getName().toLowerCase();
}
@Override
public LispObject execute() throws ConditionThrowable
{
load();
return symbol.execute();
}
@Override
public LispObject execute(LispObject arg) throws ConditionThrowable
{
load();
return symbol.execute(arg);
}
@Override
public LispObject execute(LispObject first, LispObject second)
throws ConditionThrowable
{
......@@ -171,6 +174,7 @@ public class Autoload extends Function
return symbol.execute(first, second);
}
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third)
throws ConditionThrowable
......@@ -179,6 +183,7 @@ public class Autoload extends Function
return symbol.execute(first, second, third);
}
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third, LispObject fourth)
throws ConditionThrowable
......@@ -187,6 +192,7 @@ public class Autoload extends Function
return symbol.execute(first, second, third, fourth);
}
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third, LispObject fourth,
LispObject fifth)
......@@ -196,6 +202,7 @@ public class Autoload extends Function
return symbol.execute(first, second, third, fourth, fifth);
}
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third, LispObject fourth,
LispObject fifth, LispObject sixth)
......@@ -205,6 +212,7 @@ public class Autoload extends Function
return symbol.execute(first, second, third, fourth, fifth, sixth);
}
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third, LispObject fourth,
LispObject fifth, LispObject sixth,
......@@ -216,6 +224,7 @@ public class Autoload extends Function
seventh);
}
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third, LispObject fourth,
LispObject fifth, LispObject sixth,
......@@ -227,12 +236,14 @@ public class Autoload extends Function
seventh, eighth);
}
@Override
public LispObject execute(LispObject[] args) throws ConditionThrowable
{
load();
return symbol.execute(args);
}
@Override
public String writeToString() throws ConditionThrowable
{
StringBuffer sb = new StringBuffer("#<AUTOLOAD ");
......@@ -255,6 +266,7 @@ public class Autoload extends Function
private static final Primitive AUTOLOAD =
new Primitive("autoload", PACKAGE_EXT, true)
{
@Override
public LispObject execute(LispObject first) throws ConditionThrowable
{
if (first instanceof Symbol) {
......@@ -271,6 +283,7 @@ public class Autoload extends Function
}
return error(new TypeError(first));
}
@Override
public LispObject execute(LispObject first, LispObject second)
throws ConditionThrowable
{
......@@ -296,6 +309,7 @@ public class Autoload extends Function
private static final Primitive RESOLVE =
new Primitive("resolve", PACKAGE_EXT, true, "symbol")
{
@Override
public LispObject execute(LispObject arg) throws ConditionThrowable
{
Symbol symbol = checkSymbol(arg);
......@@ -313,6 +327,7 @@ public class Autoload extends Function
private static final Primitive AUTOLOADP =
new Primitive("autoloadp", PACKAGE_EXT, true, "symbol")
{
@Override
public LispObject execute(LispObject arg) throws ConditionThrowable
{
if (arg instanceof Symbol) {
......
......@@ -55,11 +55,13 @@ public final class AutoloadMacro extends Autoload
symbol.setSymbolFunction(am);
}
@Override
public void load() throws ConditionThrowable
{
Load.loadSystemFile(getFileName(), true);
}
@Override
public String writeToString() throws ConditionThrowable
{
StringBuffer sb = new StringBuffer("#<AUTOLOAD-MACRO ");
......@@ -74,6 +76,7 @@ public final class AutoloadMacro extends Autoload
private static final Primitive AUTOLOAD_MACRO =
new Primitive("autoload-macro", PACKAGE_EXT, true)
{
@Override
public LispObject execute(LispObject first) throws ConditionThrowable
{
if (first instanceof Symbol) {
......@@ -90,6 +93,7 @@ public final class AutoloadMacro extends Autoload
}
return error(new TypeError(first));
}
@Override
public LispObject execute(LispObject first, LispObject second)
throws ConditionThrowable
{
......
......@@ -55,17 +55,20 @@ public final class BasicVector_UnsignedByte16 extends AbstractVector
elements[i] = Fixnum.getValue(array[i]);
}
@Override
public LispObject typeOf()
{
return list3(Symbol.SIMPLE_ARRAY, UNSIGNED_BYTE_16,
new Cons(new Fixnum(capacity)));
}
@Override
public LispObject classOf()
{
return BuiltInClass.VECTOR;
}
@Override
public LispObject typep(LispObject type) throws ConditionThrowable
{
if (type == Symbol.SIMPLE_ARRAY)
......@@ -75,36 +78,43 @@ public final class BasicVector_UnsignedByte16 extends AbstractVector
return super.typep(type);
}
@Override
public LispObject getElementType()
{
return UNSIGNED_BYTE_16;
}
@Override
public boolean isSimpleVector()
{
return false;
}
@Override
public boolean hasFillPointer()
{
return false;
}
@Override
public boolean isAdjustable()
{
return false;
}
@Override
public int capacity()
{
return capacity;
}
@Override
public int length()
{
return capacity;
}
@Override
public LispObject elt(int index) throws ConditionThrowable
{
try {
......@@ -117,6 +127,7 @@ public final class BasicVector_UnsignedByte16 extends AbstractVector
}
// Ignores fill pointer.
@Override
public int aref(int index) throws ConditionThrowable
{
try {
......@@ -130,6 +141,7 @@ public final class BasicVector_UnsignedByte16 extends AbstractVector
}
// Ignores fill pointer.
@Override
public LispObject AREF(int index) throws ConditionThrowable
{
try {
......@@ -142,6 +154,7 @@ public final class BasicVector_UnsignedByte16 extends AbstractVector
}
// Ignores fill pointer.
@Override
public LispObject AREF(LispObject index) throws ConditionThrowable
{
try {
......@@ -156,6 +169,7 @@ public final class BasicVector_UnsignedByte16 extends AbstractVector
}
}
@Override
public void aset(int index, int n) throws ConditionThrowable
{
try {
......@@ -166,6 +180,7 @@ public final class BasicVector_UnsignedByte16 extends AbstractVector
}
}
@Override
public void aset(int index, LispObject obj) throws ConditionThrowable
{
try {
......@@ -179,6 +194,7 @@ public final class BasicVector_UnsignedByte16 extends AbstractVector
}
}
@Override
public LispObject subseq(int start, int end) throws ConditionThrowable
{
BasicVector_UnsignedByte16 v = new BasicVector_UnsignedByte16(end - start);
......@@ -193,6 +209,7 @@ public final class BasicVector_UnsignedByte16 extends AbstractVector
}
}
@Override
public void fill(LispObject obj) throws ConditionThrowable
{
int n = Fixnum.getValue(obj);
......@@ -200,6 +217,7 @@ public final class BasicVector_UnsignedByte16 extends AbstractVector
elements[i] = n;
}
@Override
public void shrink(int n) throws ConditionThrowable
{
if (n < capacity) {
......@@ -214,6 +232,7 @@ public final class BasicVector_UnsignedByte16 extends AbstractVector
error(new LispError());
}
@Override
public LispObject reverse() throws ConditionThrowable
{
BasicVector_UnsignedByte16 result = new BasicVector_UnsignedByte16(capacity);
......@@ -223,6 +242,7 @@ public final class BasicVector_UnsignedByte16 extends AbstractVector
return result;
}
@Override
public LispObject nreverse() throws ConditionThrowable
{
int i = 0;
......@@ -237,6 +257,7 @@ public final class BasicVector_UnsignedByte16 extends AbstractVector
return this;
}
@Override
public AbstractVector adjustVector(int newCapacity,
LispObject initialElement,
LispObject initialContents)
......@@ -269,6 +290,7 @@ public final class BasicVector_UnsignedByte16 extends AbstractVector
return this;
}
@Override
public AbstractVector adjustVector(int newCapacity,
AbstractArray displacedTo,
int displacement)
......
......@@ -56,17 +56,20 @@ public final class BasicVector_UnsignedByte32 extends AbstractVector
elements[i] = array[i].longValue();
}
@Override
public LispObject typeOf()
{
return list3(Symbol.SIMPLE_ARRAY, UNSIGNED_BYTE_32,
new Cons(new Fixnum(capacity)));
}
@Override
public LispObject classOf()
{
return BuiltInClass.VECTOR;
}
@Override
public LispObject typep(LispObject type) throws ConditionThrowable
{
if (type == Symbol.SIMPLE_ARRAY)
......@@ -76,36 +79,43 @@ public final class BasicVector_UnsignedByte32 extends AbstractVector
return super.typep(type);
}
@Override
public LispObject getElementType()
{
return UNSIGNED_BYTE_32;
}
@Override
public boolean isSimpleVector()
{
return false;
}
@Override
public boolean hasFillPointer()
{
return false;
}
@Override
public boolean isAdjustable()
{
return false;
}
@Override
public int capacity()
{
return capacity;
}
@Override
public int length()
{
return capacity;
}
@Override
public LispObject elt(int index) throws ConditionThrowable
{
try
......@@ -119,6 +129,7 @@ public final class BasicVector_UnsignedByte32 extends AbstractVector
}
}
@Override
public int aref(int index) throws ConditionThrowable
{
try
......@@ -132,6 +143,7 @@ public final class BasicVector_UnsignedByte32 extends AbstractVector
}
}
@Override
public long aref_long(int index) throws ConditionThrowable
{
try
......@@ -145,6 +157,7 @@ public final class BasicVector_UnsignedByte32 extends AbstractVector
}
}
@Override
public LispObject AREF(int index) throws ConditionThrowable
{
try
......@@ -158,6 +171,7 @@ public final class BasicVector_UnsignedByte32 extends AbstractVector
}
}
@Override
public LispObject AREF(LispObject index) throws ConditionThrowable
{