Jatha Software

org.jatha.dynatype
Class StandardLispString

java.lang.Object
  extended by org.jatha.dynatype.StandardLispValue
      extended by org.jatha.dynatype.StandardLispAtom
          extended by org.jatha.dynatype.StandardLispString
All Implemented Interfaces:
Comparable, LispAtom, LispString, LispValue

public class StandardLispString
extends StandardLispAtom
implements LispString


Field Summary
private  String str
           
 
Fields inherited from class org.jatha.dynatype.StandardLispValue
f_lisp
 
Constructor Summary
StandardLispString()
           
StandardLispString(Jatha lisp, String strName)
           
 
Method Summary
 boolean basic_constantp()
          Returns Java true if the object is a constant.
 LispValue basic_elt(int n)
           
 int basic_length()
          Returns the Java length of a list or string.
 boolean basic_stringp()
          Returns Java true if the object is a string.
 LispValue concatenate(LispValue values)
          Concatenate a string to another string.
 LispValue constantp()
          Returns T if the object is a constant.
 LispValue eighth()
          Returns the 8th element of a list.
 LispValue elt(int index)
           
 LispValue elt(LispValue index)
          Returns the nth element of a list.
 LispValue eql(LispValue other)
          Returns T if the argument is EQ to the object or if the arguments and object are numbers with equal values.
 LispValue equal(LispValue other)
          Returns T if the argument is EQL or if two strings are STRING= or if two trees have EQUAL subtrees.
 boolean equals(LispValue other)
           
 LispValue fifth()
          Returns the fifth element of a list, or NIL if the list is shorter than 5 elements.
 LispValue first()
          Returns the first element of a list.
 LispValue fourth()
          Returns the 4th element of a list, or NIL if the list is shorter than 4 elements.
 String getValue()
          Returns a Java string containing this value.
 void internal_prin1(PrintStream os)
           
 void internal_princ(PrintStream os)
           
 void internal_print(PrintStream os)
           
 LispValue last()
          Returns the last character in the string.
 LispValue length()
          Returns the length of a list or string.
 LispValue ninth()
          Returns the ninth element of a list, or NIL if the list is shorter than nine elements.
 LispValue nstringCapitalize()
          For Common LISP compatibility, but identical to stringCapitalize.
 LispValue nstringDowncase()
          For Common LISP compatibility, but identical to stringDowncase.
 LispValue nstringUpcase()
          For Common LISP compatibility, but identical to stringUpcase.
 LispValue position(LispValue element)
          Returns the index of an element in a sequence.
 LispValue readFromString()
          Reads a value from the given string.
 LispValue second()
          Returns the second element of a list or NIL if the list is shorter than two elements.
 LispValue seventh()
          Returns the seventh element of a list or NIL if the list is shorter than seven elements.
 LispValue sixth()
          Returns the sixth element of a list or NIL if the list is shorter than six elements.
 LispValue string()
          Converts a String, Symbol or Character to a string.
 LispValue stringCapitalize()
          Capitalizes the first character of a string and converts the remaining characters to lower case.
 LispValue stringDowncase()
          Converts all of the characters to lower case.
 LispValue stringEndsWith(LispValue arg)
          Not in Common LISP, but useful.
 LispValue stringEq(LispValue arg)
          Returns T if the argument is an identical string to the object.
 LispValue stringEqual(LispValue arg)
          Returns T if the argument is an identical string to the object.
 LispValue stringGreaterP(LispValue arg)
          This is the LISP string-greaterp function.
 LispValue stringGreaterThan(LispValue arg)
          This is the LISP string> function.
 LispValue stringGreaterThanOrEqual(LispValue arg)
          This is the LISP string>= function.
 LispValue stringLeftTrim()
          Trims the left end of the string by deleting whitespace on both ends.
 LispValue stringLeftTrim(LispValue deleteBag)
          Trims the left end of the string by deleting characters in the input string on both ends.
 LispValue stringLessP(LispValue arg)
          This is the LISP string-lessp function.
 LispValue stringLessThan(LispValue arg)
          This is the LISP string< function.
 LispValue stringLessThanOrEqual(LispValue arg)
          This is the LISP string<= function.
 LispValue stringNeq(LispValue arg)
          Returns T if the argument is not STRING= the given string.
 LispValue stringNotGreaterP(LispValue arg)
          This is the LISP string-not-greaterp function.
 LispValue stringNotLessP(LispValue arg)
          This is the LISP string-not-lessp function.
 LispValue stringp()
          Returns T if the object is a string.
 LispValue stringRightTrim()
          Trims the right end of the string by deleting whitespace on both ends.
 LispValue stringRightTrim(LispValue deleteBag)
          Trims the right end of the string by deleting characters in the input string on both ends.
 LispValue stringStartsWith(LispValue arg)
          Not in Common LISP, but useful.
 LispValue stringTrim()
          Trims the string by deleting whitespace on both ends.
 LispValue stringTrim(LispValue deleteBag)
          Trims the string by deleting characters in the input string on both ends.
 LispValue stringUpcase()
          Converts all the characters to upper case.
 LispValue substring(LispValue start)
          Returns the substring starting at position START to the end.
 LispValue substring(LispValue start, LispValue end)
          Returns the substring starting at position START to the end.
 LispValue tenth()
          Returns the tenth element of a list or NIL if the list is less than ten elements long.
 LispValue third()
          Returns the third element of a list or NIL if the list is less than three elements long.
 Object toJava()
          Returns a Java String object with the value of this string.
 String toString()
          toString() returns a printed representation of the form (as printed by (prin1)) in a Java string.
 String toStringSimple()
          Strips double-quotes from a LispString value.
 LispValue type_of()
           
 LispValue typep(LispValue type)
           
 
Methods inherited from class org.jatha.dynatype.StandardLispAtom
atom, basic_atom
 
Methods inherited from class org.jatha.dynatype.StandardLispValue
abs, acos, add, adjustSpecialCount, append, apply, apropos_print, asin, assoc, atan, atan2, basic_bignump, basic_consp, basic_floatp, basic_foreignp, basic_functionp, basic_integerp, basic_keywordp, basic_listp, basic_macrop, basic_null, basic_numberp, basic_symbolp, bignump, boundp, butlast, car, cdr, ceiling, characterp, clrhash, compareTo, consp, contains, copy_list, copy, cos, cot, csc, degreesToRadians, divide, documentation, eq, equalNumeric, factorial, fboundp, floatp, floor, funcall, functionp, get_specialCount, gethash, gethash, getLisp, greaterThan, greaterThanOrEqual, hash_table_count, hash_table_rehash_size, hash_table_rehash_threshold, hash_table_size, hash_table_test, hashtablep, integerp, internal_getName, internal_prin1_as_cdr, internal_princ_as_cdr, internal_print_as_cdr, iterator, keywordp, lessThan, lessThanOrEqual, lisp_null, list, listp, max, member, min, multiply, nconc, negate, neql, nreverse, numberp, pop, prin1, princ, print, push, radiansToDegrees, rassoc, reciprocal, remhash, remove, rest, reverse, rplaca, rplacd, sec, set_special, setf_documentation, setf_gethash, setf_symbol_function, setf_symbol_plist, setf_symbol_value, setLisp, setPackage, setq, showStackTrace, sin, specialP, sqrt, subst, subtract, symbol_function, symbol_name, symbol_package, symbol_plist, symbol_value, symbolp, tan, toCollection, toJava, toString, toStringAsCdr_internal, toStringAsCdr, toStringShort, toStringShort, uses, zerop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jatha.dynatype.LispValue
abs, acos, add, adjustSpecialCount, append, apply, apropos_print, asin, assoc, atan, atan2, atom, basic_atom, basic_bignump, basic_consp, basic_floatp, basic_foreignp, basic_functionp, basic_integerp, basic_keywordp, basic_listp, basic_macrop, basic_null, basic_numberp, basic_symbolp, bignump, boundp, butlast, car, cdr, ceiling, characterp, clrhash, compareTo, consp, contains, copy_list, copy, cos, cot, csc, degreesToRadians, divide, documentation, eq, equalNumeric, factorial, fboundp, floatp, floor, funcall, functionp, get_specialCount, gethash, gethash, getLisp, greaterThan, greaterThanOrEqual, hash_table_count, hash_table_rehash_size, hash_table_rehash_threshold, hash_table_size, hash_table_test, hashtablep, integerp, internal_getName, internal_prin1_as_cdr, internal_princ_as_cdr, internal_print_as_cdr, iterator, keywordp, lessThan, lessThanOrEqual, lisp_null, list, listp, max, member, min, multiply, nconc, negate, neql, nreverse, numberp, pop, prin1, princ, print, push, radiansToDegrees, rassoc, reciprocal, remhash, remove, rest, reverse, rplaca, rplacd, sec, set_special, setf_documentation, setf_gethash, setf_symbol_function, setf_symbol_plist, setf_symbol_value, setLisp, setPackage, setq, sin, specialP, sqrt, subst, subtract, symbol_function, symbol_name, symbol_package, symbol_plist, symbol_value, symbolp, tan, toCollection, toJava, toString, toStringAsCdr_internal, toStringAsCdr, toStringShort, toStringShort, uses, zerop
 

Field Detail

str

private String str
Constructor Detail

StandardLispString

public StandardLispString()

StandardLispString

public StandardLispString(Jatha lisp,
                          String strName)
Method Detail

getValue

public String getValue()
Description copied from interface: LispString
Returns a Java string containing this value.

Specified by:
getValue in interface LispString

internal_princ

public void internal_princ(PrintStream os)
Specified by:
internal_princ in interface LispValue
Overrides:
internal_princ in class StandardLispValue

internal_prin1

public void internal_prin1(PrintStream os)
Specified by:
internal_prin1 in interface LispValue
Overrides:
internal_prin1 in class StandardLispValue

internal_print

public void internal_print(PrintStream os)
Specified by:
internal_print in interface LispValue
Overrides:
internal_print in class StandardLispValue

toJava

public Object toJava()
Returns a Java String object with the value of this string.

Specified by:
toJava in interface LispValue
Overrides:
toJava in class StandardLispValue

toString

public String toString()
Description copied from class: StandardLispValue
toString() returns a printed representation of the form (as printed by (prin1)) in a Java string.

Specified by:
toString in interface LispValue
Overrides:
toString in class StandardLispValue
Returns:
String The value in a string.

toStringSimple

public String toStringSimple()
Strips double-quotes from a LispString value.

Specified by:
toStringSimple in interface LispValue
Overrides:
toStringSimple in class StandardLispValue

basic_constantp

public boolean basic_constantp()
Description copied from interface: LispValue
Returns Java true if the object is a constant.

Specified by:
basic_constantp in interface LispValue
Overrides:
basic_constantp in class StandardLispValue

basic_elt

public LispValue basic_elt(int n)
Specified by:
basic_elt in interface LispString

basic_length

public int basic_length()
Description copied from interface: LispValue
Returns the Java length of a list or string.

Specified by:
basic_length in interface LispValue
Overrides:
basic_length in class StandardLispValue

basic_stringp

public boolean basic_stringp()
Description copied from interface: LispValue
Returns Java true if the object is a string.

Specified by:
basic_stringp in interface LispValue
Overrides:
basic_stringp in class StandardLispValue

concatenate

public LispValue concatenate(LispValue values)
Concatenate a string to another string. Passing in any LispValue causes it to be converted to a string and concatenated to the end. Must be at least two arguments, the first of which is 'STRING. This returns a new LispString.

Specified by:
concatenate in interface LispValue
Overrides:
concatenate in class StandardLispValue

constantp

public LispValue constantp()
Description copied from interface: LispValue
Returns T if the object is a constant.

Specified by:
constantp in interface LispValue
Overrides:
constantp in class StandardLispValue

elt

public LispValue elt(int index)
Specified by:
elt in interface LispValue
Overrides:
elt in class StandardLispValue

elt

public LispValue elt(LispValue index)
Description copied from interface: LispValue
Returns the nth element of a list. The zeroth element is the first element.

Specified by:
elt in interface LispValue
Overrides:
elt in class StandardLispValue

eql

public LispValue eql(LispValue other)
Description copied from interface: LispValue
Returns T if the argument is EQ to the object or if the arguments and object are numbers with equal values.

Specified by:
eql in interface LispValue
Overrides:
eql in class StandardLispValue

equal

public LispValue equal(LispValue other)
Description copied from interface: LispValue
Returns T if the argument is EQL or if two strings are STRING= or if two trees have EQUAL subtrees.

Specified by:
equal in interface LispValue
Overrides:
equal in class StandardLispValue

equals

public boolean equals(LispValue other)

first

public LispValue first()
Description copied from interface: LispValue
Returns the first element of a list. Identical to the CAR function.

Specified by:
first in interface LispValue
Overrides:
first in class StandardLispValue

second

public LispValue second()
Description copied from interface: LispValue
Returns the second element of a list or NIL if the list is shorter than two elements.

Specified by:
second in interface LispValue
Overrides:
second in class StandardLispValue

third

public LispValue third()
Description copied from interface: LispValue
Returns the third element of a list or NIL if the list is less than three elements long.

Specified by:
third in interface LispValue
Overrides:
third in class StandardLispValue

fourth

public LispValue fourth()
Description copied from interface: LispValue
Returns the 4th element of a list, or NIL if the list is shorter than 4 elements.

Specified by:
fourth in interface LispValue
Overrides:
fourth in class StandardLispValue

fifth

public LispValue fifth()
Description copied from interface: LispValue
Returns the fifth element of a list, or NIL if the list is shorter than 5 elements.

Specified by:
fifth in interface LispValue
Overrides:
fifth in class StandardLispValue

sixth

public LispValue sixth()
Description copied from interface: LispValue
Returns the sixth element of a list or NIL if the list is shorter than six elements.

Specified by:
sixth in interface LispValue
Overrides:
sixth in class StandardLispValue

seventh

public LispValue seventh()
Description copied from interface: LispValue
Returns the seventh element of a list or NIL if the list is shorter than seven elements.

Specified by:
seventh in interface LispValue
Overrides:
seventh in class StandardLispValue

eighth

public LispValue eighth()
Description copied from interface: LispValue
Returns the 8th element of a list. If the list is shorter than 8 elements, returns NIL.

Specified by:
eighth in interface LispValue
Overrides:
eighth in class StandardLispValue

ninth

public LispValue ninth()
Description copied from interface: LispValue
Returns the ninth element of a list, or NIL if the list is shorter than nine elements.

Specified by:
ninth in interface LispValue
Overrides:
ninth in class StandardLispValue

tenth

public LispValue tenth()
Description copied from interface: LispValue
Returns the tenth element of a list or NIL if the list is less than ten elements long.

Specified by:
tenth in interface LispValue
Overrides:
tenth in class StandardLispValue

last

public LispValue last()
Returns the last character in the string.

Specified by:
last in interface LispValue
Overrides:
last in class StandardLispValue

length

public LispValue length()
Description copied from interface: LispValue
Returns the length of a list or string.

Specified by:
length in interface LispValue
Overrides:
length in class StandardLispValue

stringp

public LispValue stringp()
Description copied from interface: LispValue
Returns T if the object is a string.

Specified by:
stringp in interface LispValue
Overrides:
stringp in class StandardLispValue

nstringUpcase

public LispValue nstringUpcase()
For Common LISP compatibility, but identical to stringUpcase.

Specified by:
nstringUpcase in interface LispValue
Overrides:
nstringUpcase in class StandardLispValue

nstringCapitalize

public LispValue nstringCapitalize()
For Common LISP compatibility, but identical to stringCapitalize.

Specified by:
nstringCapitalize in interface LispValue
Overrides:
nstringCapitalize in class StandardLispValue

nstringDowncase

public LispValue nstringDowncase()
For Common LISP compatibility, but identical to stringDowncase.

Specified by:
nstringDowncase in interface LispValue
Overrides:
nstringDowncase in class StandardLispValue

position

public LispValue position(LispValue element)
Returns the index of an element in a sequence. Currently works for lists and strings. Comparison is by EQL for lists and CHAR= for lists. Returns NIL if the element is not found in the sequence.

Specified by:
position in interface LispValue
Overrides:
position in class StandardLispValue

readFromString

public LispValue readFromString()
Reads a value from the given string.

Specified by:
readFromString in interface LispValue
Overrides:
readFromString in class StandardLispValue
Returns:
a LispValue as read by the LISP Reader

string

public LispValue string()
Converts a String, Symbol or Character to a string.

Specified by:
string in interface LispValue
Overrides:
string in class StandardLispValue

stringCapitalize

public LispValue stringCapitalize()
Capitalizes the first character of a string and converts the remaining characters to lower case.

Specified by:
stringCapitalize in interface LispValue
Overrides:
stringCapitalize in class StandardLispValue

stringDowncase

public LispValue stringDowncase()
Converts all of the characters to lower case.

Specified by:
stringDowncase in interface LispValue
Overrides:
stringDowncase in class StandardLispValue

stringEndsWith

public LispValue stringEndsWith(LispValue arg)
Not in Common LISP, but useful. This is case-sensitive.

Specified by:
stringEndsWith in interface LispValue
Overrides:
stringEndsWith in class StandardLispValue

stringEq

public LispValue stringEq(LispValue arg)
Returns T if the argument is an identical string to the object. Character comparison is case-sensitive. This is the LISP string= function.

Specified by:
stringEq in interface LispValue
Overrides:
stringEq in class StandardLispValue

stringEqual

public LispValue stringEqual(LispValue arg)
Returns T if the argument is an identical string to the object. Character comparison is case-insensitive. STRING-EQUAL.

Specified by:
stringEqual in interface LispValue
Overrides:
stringEqual in class StandardLispValue

stringGreaterP

public LispValue stringGreaterP(LispValue arg)
This is the LISP string-greaterp function. Case-insensitive comparison for ordering.

Specified by:
stringGreaterP in interface LispValue
Overrides:
stringGreaterP in class StandardLispValue

stringGreaterThan

public LispValue stringGreaterThan(LispValue arg)
This is the LISP string> function. Case-sensitive comparison for ordering.

Specified by:
stringGreaterThan in interface LispValue
Overrides:
stringGreaterThan in class StandardLispValue

stringGreaterThanOrEqual

public LispValue stringGreaterThanOrEqual(LispValue arg)
This is the LISP string>= function. Case-sensitive comparison for ordering.

Specified by:
stringGreaterThanOrEqual in interface LispValue
Overrides:
stringGreaterThanOrEqual in class StandardLispValue

stringLeftTrim

public LispValue stringLeftTrim()
Trims the left end of the string by deleting whitespace on both ends.

Specified by:
stringLeftTrim in interface LispValue
Overrides:
stringLeftTrim in class StandardLispValue

stringLeftTrim

public LispValue stringLeftTrim(LispValue deleteBag)
Trims the left end of the string by deleting characters in the input string on both ends.

Specified by:
stringLeftTrim in interface LispValue
Overrides:
stringLeftTrim in class StandardLispValue

stringLessP

public LispValue stringLessP(LispValue arg)
This is the LISP string-lessp function. Case-insensitive comparison for ordering.

Specified by:
stringLessP in interface LispValue
Overrides:
stringLessP in class StandardLispValue

stringLessThan

public LispValue stringLessThan(LispValue arg)
This is the LISP string< function. Case-sensitive comparison for ordering.

Specified by:
stringLessThan in interface LispValue
Overrides:
stringLessThan in class StandardLispValue

stringLessThanOrEqual

public LispValue stringLessThanOrEqual(LispValue arg)
This is the LISP string<= function. Case-sensitive comparison for ordering.

Specified by:
stringLessThanOrEqual in interface LispValue
Overrides:
stringLessThanOrEqual in class StandardLispValue

stringNeq

public LispValue stringNeq(LispValue arg)
Returns T if the argument is not STRING= the given string.

Specified by:
stringNeq in interface LispValue
Overrides:
stringNeq in class StandardLispValue

stringNotGreaterP

public LispValue stringNotGreaterP(LispValue arg)
This is the LISP string-not-greaterp function. Case-insensitive comparison for ordering.

Specified by:
stringNotGreaterP in interface LispValue
Overrides:
stringNotGreaterP in class StandardLispValue

stringNotLessP

public LispValue stringNotLessP(LispValue arg)
This is the LISP string-not-lessp function. Case-insensitive comparison for ordering.

Specified by:
stringNotLessP in interface LispValue
Overrides:
stringNotLessP in class StandardLispValue

stringRightTrim

public LispValue stringRightTrim()
Trims the right end of the string by deleting whitespace on both ends.

Specified by:
stringRightTrim in interface LispValue
Overrides:
stringRightTrim in class StandardLispValue

stringRightTrim

public LispValue stringRightTrim(LispValue deleteBag)
Trims the right end of the string by deleting characters in the input string on both ends.

Specified by:
stringRightTrim in interface LispValue
Overrides:
stringRightTrim in class StandardLispValue

stringStartsWith

public LispValue stringStartsWith(LispValue arg)
Not in Common LISP, but useful. This is case-sensitive.

Specified by:
stringStartsWith in interface LispValue
Overrides:
stringStartsWith in class StandardLispValue

stringTrim

public LispValue stringTrim()
Trims the string by deleting whitespace on both ends.

Specified by:
stringTrim in interface LispValue
Overrides:
stringTrim in class StandardLispValue

stringTrim

public LispValue stringTrim(LispValue deleteBag)
Trims the string by deleting characters in the input string on both ends.

Specified by:
stringTrim in interface LispValue
Overrides:
stringTrim in class StandardLispValue

stringUpcase

public LispValue stringUpcase()
Converts all the characters to upper case.

Specified by:
stringUpcase in interface LispValue
Overrides:
stringUpcase in class StandardLispValue

substring

public LispValue substring(LispValue start)
Returns the substring starting at position START to the end. Returns an empty string if START is past the last position in the string. START must be positive.

Specified by:
substring in interface LispValue
Overrides:
substring in class StandardLispValue

substring

public LispValue substring(LispValue start,
                           LispValue end)
Returns the substring starting at position START to the end. Returns an empty string if START is past the last position in the string. START must be positive.

Specified by:
substring in interface LispValue
Overrides:
substring in class StandardLispValue

type_of

public LispValue type_of()
Specified by:
type_of in interface LispValue
Overrides:
type_of in class StandardLispValue

typep

public LispValue typep(LispValue type)
Specified by:
typep in interface LispValue
Overrides:
typep in class StandardLispAtom

Jatha Software