[armedbear-cvs] r12474 - trunk/abcl/src/org/armedbear/lisp
Ville Voutilainen
vvoutilainen at common-lisp.net
Sun Feb 14 15:14:42 UTC 2010
Author: vvoutilainen
Date: Sun Feb 14 10:14:40 2010
New Revision: 12474
Log:
Reindentation.
Modified:
trunk/abcl/src/org/armedbear/lisp/StringFunctions.java
Modified: trunk/abcl/src/org/armedbear/lisp/StringFunctions.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/StringFunctions.java (original)
+++ trunk/abcl/src/org/armedbear/lisp/StringFunctions.java Sun Feb 14 10:14:40 2010
@@ -35,17 +35,15 @@
import static org.armedbear.lisp.Lisp.*;
-public final class StringFunctions
-{
+public final class StringFunctions {
// ### %string=
// Case sensitive.
private static final Primitive _STRING_EQUAL = new pf__string_equal();
- private static final class pf__string_equal extends Primitive {
- pf__string_equal()
- {
- super("%string=", PACKAGE_SYS, false);
- }
-
+ private static final class pf__string_equal extends Primitive {
+ pf__string_equal() {
+ super("%string=", PACKAGE_SYS, false);
+ }
+
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third, LispObject fourth,
@@ -74,8 +72,7 @@
if (array1[i] != array2[j])
return NIL;
}
- }
- catch (ArrayIndexOutOfBoundsException e) {
+ } catch (ArrayIndexOutOfBoundsException e) {
// Shouldn't happen.
Debug.trace(e);
return NIL;
@@ -87,12 +84,11 @@
// ### %%string=
// Case sensitive.
private static final Primitive __STRING_EQUAL = new pf___string_equal();
- private static final class pf___string_equal extends Primitive {
- pf___string_equal()
- {
- super("%%string=", PACKAGE_SYS, false);
- }
-
+ private static final class pf___string_equal extends Primitive {
+ pf___string_equal() {
+ super("%%string=", PACKAGE_SYS, false);
+ }
+
@Override
public LispObject execute(LispObject first, LispObject second)
@@ -112,15 +108,13 @@
// ### %string/=
// Case sensitive.
private static final Primitive _STRING_NOT_EQUAL = new pf__string_not_equal();
- private static final class pf__string_not_equal extends Primitive {
- pf__string_not_equal()
- {
- super("%string/=", PACKAGE_SYS, true);
- }
-
+ private static final class pf__string_not_equal extends Primitive {
+ pf__string_not_equal() {
+ super("%string/=", PACKAGE_SYS, true);
+ }
+
@Override
- public LispObject execute(LispObject[] args)
- {
+ public LispObject execute(LispObject[] args) {
if (args.length != 6)
return error(new WrongNumberOfArgumentsException(this));
char[] array1 = args[0].STRING().getStringChars();
@@ -153,12 +147,11 @@
// ### %string-equal
// Case insensitive.
private static final Primitive _STRING_EQUAL_IGNORE_CASE = new pf__string_equal_ignore_case();
- private static final class pf__string_equal_ignore_case extends Primitive {
- pf__string_equal_ignore_case()
- {
- super("%string-equal", PACKAGE_SYS, true);
- }
-
+ private static final class pf__string_equal_ignore_case extends Primitive {
+ pf__string_equal_ignore_case() {
+ super("%string-equal", PACKAGE_SYS, true);
+ }
+
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third, LispObject fourth,
@@ -192,15 +185,13 @@
// ### %string-not-equal
// Case sensitive.
private static final Primitive _STRING_NOT_EQUAL_IGNORE_CASE = new pf__string_not_equal_ignore_case();
- private static final class pf__string_not_equal_ignore_case extends Primitive {
- pf__string_not_equal_ignore_case()
- {
- super("%string-not-equal", PACKAGE_SYS, true);
- }
-
+ private static final class pf__string_not_equal_ignore_case extends Primitive {
+ pf__string_not_equal_ignore_case() {
+ super("%string-not-equal", PACKAGE_SYS, true);
+ }
+
@Override
- public LispObject execute(LispObject[] args)
- {
+ public LispObject execute(LispObject[] args) {
if (args.length != 6)
return error(new WrongNumberOfArgumentsException(this));
char[] array1 = args[0].STRING().getStringChars();
@@ -225,9 +216,8 @@
char c1 = array1[i];
char c2 = array2[j];
if (c1 == c2 ||
- LispCharacter.toUpperCase(c1) == LispCharacter.toUpperCase(c2) ||
- LispCharacter.toLowerCase(c1) == LispCharacter.toLowerCase(c2))
- {
+ LispCharacter.toUpperCase(c1) == LispCharacter.toUpperCase(c2) ||
+ LispCharacter.toLowerCase(c1) == LispCharacter.toLowerCase(c2)) {
++i;
++j;
continue;
@@ -240,15 +230,13 @@
// ### %string<
// Case sensitive.
private static final Primitive _STRING_LESS_THAN = new pf__string_less_than();
- private static final class pf__string_less_than extends Primitive {
- pf__string_less_than()
- {
- super("%string<", PACKAGE_SYS, true);
- }
-
+ private static final class pf__string_less_than extends Primitive {
+ pf__string_less_than() {
+ super("%string<", PACKAGE_SYS, true);
+ }
+
@Override
- public LispObject execute(LispObject[] args)
- {
+ public LispObject execute(LispObject[] args) {
if (args.length != 6)
return error(new WrongNumberOfArgumentsException(this));
char[] array1 = args[0].STRING().getStringChars();
@@ -288,15 +276,13 @@
// ### %string<=
// Case sensitive.
private static final Primitive _STRING_GREATER_THAN = new pf__string_greater_than();
- private static final class pf__string_greater_than extends Primitive {
- pf__string_greater_than()
- {
- super("%string>", PACKAGE_SYS, true);
- }
-
+ private static final class pf__string_greater_than extends Primitive {
+ pf__string_greater_than() {
+ super("%string>", PACKAGE_SYS, true);
+ }
+
@Override
- public LispObject execute(LispObject[] args)
- {
+ public LispObject execute(LispObject[] args) {
if (args.length != 6)
return error(new WrongNumberOfArgumentsException(this));
char[] array1 = args[0].STRING().getStringChars();
@@ -334,15 +320,13 @@
// ### %string<=
// Case sensitive.
private static final Primitive _STRING_LE = new pf__string_le();
- private static final class pf__string_le extends Primitive {
- pf__string_le()
- {
- super("%string<=", PACKAGE_SYS, true);
- }
-
+ private static final class pf__string_le extends Primitive {
+ pf__string_le() {
+ super("%string<=", PACKAGE_SYS, true);
+ }
+
@Override
- public LispObject execute(LispObject[] args)
- {
+ public LispObject execute(LispObject[] args) {
if (args.length != 6)
return error(new WrongNumberOfArgumentsException(this));
char[] array1 = args[0].STRING().getStringChars();
@@ -380,15 +364,13 @@
// ### %string<=
// Case sensitive.
private static final Primitive _STRING_GE = new pf__string_ge();
- private static final class pf__string_ge extends Primitive {
- pf__string_ge()
- {
- super("%string>=", PACKAGE_SYS, true);
- }
-
+ private static final class pf__string_ge extends Primitive {
+ pf__string_ge() {
+ super("%string>=", PACKAGE_SYS, true);
+ }
+
@Override
- public LispObject execute(LispObject[] args)
- {
+ public LispObject execute(LispObject[] args) {
if (args.length != 6)
return error(new WrongNumberOfArgumentsException(this));
char[] array1 = args[0].STRING().getStringChars();
@@ -428,15 +410,13 @@
// ### %string-lessp
// Case insensitive.
private static final Primitive _STRING_LESSP = new pf__string_lessp();
- private static final class pf__string_lessp extends Primitive {
- pf__string_lessp()
- {
- super("%string-lessp", PACKAGE_SYS, true);
- }
-
+ private static final class pf__string_lessp extends Primitive {
+ pf__string_lessp() {
+ super("%string-lessp", PACKAGE_SYS, true);
+ }
+
@Override
- public LispObject execute(LispObject[] args)
- {
+ public LispObject execute(LispObject[] args) {
if (args.length != 6)
return error(new WrongNumberOfArgumentsException(this));
char[] array1 = args[0].STRING().getStringChars();
@@ -476,15 +456,13 @@
// ### %string-greaterp
// Case insensitive.
private static final Primitive _STRING_GREATERP = new pf__string_greaterp();
- private static final class pf__string_greaterp extends Primitive {
- pf__string_greaterp()
- {
- super("%string-greaterp", PACKAGE_SYS, true);
- }
-
+ private static final class pf__string_greaterp extends Primitive {
+ pf__string_greaterp() {
+ super("%string-greaterp", PACKAGE_SYS, true);
+ }
+
@Override
- public LispObject execute(LispObject[] args)
- {
+ public LispObject execute(LispObject[] args) {
if (args.length != 6)
return error(new WrongNumberOfArgumentsException(this));
char[] array1 = args[0].STRING().getStringChars();
@@ -522,15 +500,13 @@
// ### %string-not-lessp
// Case insensitive.
private static final Primitive _STRING_NOT_LESSP = new pf__string_not_lessp();
- private static final class pf__string_not_lessp extends Primitive {
- pf__string_not_lessp()
- {
- super("%string-not-lessp", PACKAGE_SYS, true);
- }
-
+ private static final class pf__string_not_lessp extends Primitive {
+ pf__string_not_lessp() {
+ super("%string-not-lessp", PACKAGE_SYS, true);
+ }
+
@Override
- public LispObject execute(LispObject[] args)
- {
+ public LispObject execute(LispObject[] args) {
if (args.length != 6)
return error(new WrongNumberOfArgumentsException(this));
char[] array1 = args[0].STRING().getStringChars();
@@ -570,15 +546,13 @@
// ### %string-not-greaterp
// Case insensitive.
private static final Primitive _STRING_NOT_GREATERP = new pf__string_not_greaterp();
- private static final class pf__string_not_greaterp extends Primitive {
- pf__string_not_greaterp()
- {
- super("%string-not-greaterp", PACKAGE_SYS, true);
- }
-
+ private static final class pf__string_not_greaterp extends Primitive {
+ pf__string_not_greaterp() {
+ super("%string-not-greaterp", PACKAGE_SYS, true);
+ }
+
@Override
- public LispObject execute(LispObject[] args)
- {
+ public LispObject execute(LispObject[] args) {
if (args.length != 6)
return error(new WrongNumberOfArgumentsException(this));
char[] array1 = args[0].STRING().getStringChars();
@@ -615,12 +589,11 @@
// ### %string-upcase
private static final Primitive _STRING_UPCASE = new pf__string_upcase();
- private static final class pf__string_upcase extends Primitive {
- pf__string_upcase()
- {
- super("%string-upcase", PACKAGE_SYS, true);
- }
-
+ private static final class pf__string_upcase extends Primitive {
+ pf__string_upcase() {
+ super("%string-upcase", PACKAGE_SYS, true);
+ }
+
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third)
@@ -655,16 +628,14 @@
// ### %string-downcase
private static final Primitive _STRING_DOWNCASE = new pf__string_downcase();
- private static final class pf__string_downcase extends Primitive {
- pf__string_downcase()
- {
- super("%string-downcase", PACKAGE_SYS, true);
- }
-
+ private static final class pf__string_downcase extends Primitive {
+ pf__string_downcase() {
+ super("%string-downcase", PACKAGE_SYS, true);
+ }
+
@Override
public LispObject execute(LispObject first, LispObject second,
- LispObject third)
- {
+ LispObject third) {
LispObject s = first.STRING();
final int length = s.length();
int start = (int) Fixnum.getValue(second);
@@ -694,12 +665,11 @@
// ### %string-capitalize
private static final Primitive _STRING_CAPITALIZE = new pf__string_capitalize();
- private static final class pf__string_capitalize extends Primitive {
- pf__string_capitalize()
- {
- super("%string-capitalize", PACKAGE_SYS, true);
- }
-
+ private static final class pf__string_capitalize extends Primitive {
+ pf__string_capitalize() {
+ super("%string-capitalize", PACKAGE_SYS, true);
+ }
+
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third)
@@ -746,12 +716,11 @@
// ### %nstring-upcase
private static final Primitive _NSTRING_UPCASE = new pf__nstring_upcase();
- private static final class pf__nstring_upcase extends Primitive {
- pf__nstring_upcase()
- {
- super("%nstring-upcase", PACKAGE_SYS, true);
- }
-
+ private static final class pf__nstring_upcase extends Primitive {
+ pf__nstring_upcase() {
+ super("%nstring-upcase", PACKAGE_SYS, true);
+ }
+
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third)
@@ -779,12 +748,11 @@
// ### %nstring-downcase
private static final Primitive _NSTRING_DOWNCASE = new pf__nstring_downcase();
- private static final class pf__nstring_downcase extends Primitive {
- pf__nstring_downcase()
- {
- super("%nstring-downcase", PACKAGE_SYS, true);
- }
-
+ private static final class pf__nstring_downcase extends Primitive {
+ pf__nstring_downcase() {
+ super("%nstring-downcase", PACKAGE_SYS, true);
+ }
+
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third)
@@ -812,12 +780,11 @@
// ### %nstring-capitalize
private static final Primitive _NSTRING_CAPITALIZE = new pf__nstring_capitalize();
- private static final class pf__nstring_capitalize extends Primitive {
- pf__nstring_capitalize()
- {
- super("%nstring-capitalize", PACKAGE_SYS, true);
- }
-
+ private static final class pf__nstring_capitalize extends Primitive {
+ pf__nstring_capitalize() {
+ super("%nstring-capitalize", PACKAGE_SYS, true);
+ }
+
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third)
@@ -857,30 +824,26 @@
// ### stringp
public static final Primitive STRINGP = new pf_stringp();
- private static final class pf_stringp extends Primitive {
- pf_stringp()
- {
- super("stringp", "object");
- }
-
+ private static final class pf_stringp extends Primitive {
+ pf_stringp() {
+ super("stringp", "object");
+ }
+
@Override
- public LispObject execute(LispObject arg)
- {
+ public LispObject execute(LispObject arg) {
return arg.STRINGP();
}
};
// ### simple-string-p
public static final Primitive SIMPLE_STRING_P = new pf_simple_string_p();
- private static final class pf_simple_string_p extends Primitive {
- pf_simple_string_p()
- {
- super("simple-string-p", "object");
- }
-
+ private static final class pf_simple_string_p extends Primitive {
+ pf_simple_string_p() {
+ super("simple-string-p", "object");
+ }
+
@Override
- public LispObject execute(LispObject arg)
- {
+ public LispObject execute(LispObject arg) {
return arg.SIMPLE_STRING_P();
}
};
@@ -889,12 +852,11 @@
// %make-string size initial-element element-type => string
// Returns a simple string.
private static final Primitive _MAKE_STRING = new pf__make_string();
- private static final class pf__make_string extends Primitive {
- pf__make_string()
- {
- super("%make-string", PACKAGE_SYS, false);
- }
-
+ private static final class pf__make_string extends Primitive {
+ pf__make_string() {
+ super("%make-string", PACKAGE_SYS, false);
+ }
+
@Override
public LispObject execute(LispObject size, LispObject initialElement,
LispObject elementType)
@@ -927,28 +889,26 @@
// ### char
private static final Primitive CHAR = new pf_char();
- private static final class pf_char extends Primitive {
- pf_char()
- {
- super(Symbol.CHAR, "string index");
- }
-
+ private static final class pf_char extends Primitive {
+ pf_char() {
+ super(Symbol.CHAR, "string index");
+ }
+
@Override
public LispObject execute(LispObject first, LispObject second)
{
- return first.CHAR(Fixnum.getValue(second));
+ return first.CHAR(Fixnum.getValue(second));
}
};
// ### schar
private static final Primitive SCHAR = new pf_schar();
- private static final class pf_schar extends Primitive {
- pf_schar()
- {
- super(Symbol.SCHAR, "string index");
- }
-
+ private static final class pf_schar extends Primitive {
+ pf_schar() {
+ super(Symbol.SCHAR, "string index");
+ }
+
@Override
public LispObject execute(LispObject first, LispObject second)
@@ -959,31 +919,29 @@
// ### set-char
private static final Primitive SET_CHAR = new pf_set_char();
- private static final class pf_set_char extends Primitive {
- pf_set_char()
- {
- super(Symbol.SET_CHAR, "string index character");
- }
-
+ private static final class pf_set_char extends Primitive {
+ pf_set_char() {
+ super(Symbol.SET_CHAR, "string index character");
+ }
+
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third)
{
checkString(first).setCharAt(Fixnum.getValue(second),
- LispCharacter.getValue(third));
+ LispCharacter.getValue(third));
return third;
}
};
// ### set-schar
private static final Primitive SET_SCHAR = new pf_set_schar();
- private static final class pf_set_schar extends Primitive {
- pf_set_schar()
- {
- super(Symbol.SET_SCHAR, "string index character");
- }
-
+ private static final class pf_set_schar extends Primitive {
+ pf_set_schar() {
+ super(Symbol.SET_SCHAR, "string index character");
+ }
+
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third)
@@ -1000,12 +958,11 @@
// ### string-position
private static final Primitive STRING_POSITION = new pf_string_position();
- private static final class pf_string_position extends Primitive {
- pf_string_position()
- {
- super("string-position", PACKAGE_EXT, true);
- }
-
+ private static final class pf_string_position extends Primitive {
+ pf_string_position() {
+ super("string-position", PACKAGE_EXT, true);
+ }
+
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third)
@@ -1024,12 +981,11 @@
// ### string-find
private static final Primitive STRING_FIND = new pf_string_find();
- private static final class pf_string_find extends Primitive {
- pf_string_find()
- {
- super("string-find", PACKAGE_EXT, true, "char string");
- }
-
+ private static final class pf_string_find extends Primitive {
+ pf_string_find() {
+ super("string-find", PACKAGE_EXT, true, "char string");
+ }
+
@Override
public LispObject execute(LispObject first, LispObject second)
@@ -1050,12 +1006,11 @@
// ### simple-string-search pattern string => position
// Searches string for a substring that matches pattern.
private static final Primitive SIMPLE_STRING_SEARCH = new pf_simple_string_search();
- private static final class pf_simple_string_search extends Primitive {
- pf_simple_string_search()
- {
- super("simple-string-search", PACKAGE_EXT, true);
- }
-
+ private static final class pf_simple_string_search extends Primitive {
+ pf_simple_string_search() {
+ super("simple-string-search", PACKAGE_EXT, true);
+ }
+
@Override
public LispObject execute(LispObject first, LispObject second)
@@ -1068,17 +1023,16 @@
// ### simple-string-fill string character => string
private static final Primitive STRING_FILL = new pf_string_fill();
- private static final class pf_string_fill extends Primitive {
- pf_string_fill()
- {
- super("simple-string-fill", PACKAGE_EXT, true);
- }
-
+ private static final class pf_string_fill extends Primitive {
+ pf_string_fill() {
+ super("simple-string-fill", PACKAGE_EXT, true);
+ }
+
@Override
public LispObject execute(LispObject first, LispObject second)
{
- if(first instanceof AbstractString) {
+ if (first instanceof AbstractString) {
AbstractString s = (AbstractString) first;
s.fill(LispCharacter.getValue(second));
return first;
@@ -1086,5 +1040,5 @@
return type_error(first, Symbol.SIMPLE_STRING);
}
};
-
+
}
More information about the armedbear-cvs
mailing list