Class PsyString

java.lang.Object
coneforest.psylla.core.PsyString
All Implemented Interfaces:
PsyConcatenable<PsyString>, PsyConvertableToInteger, PsyConvertableToIntegral, PsyConvertableToRational, PsyConvertableToReal, PsyEvaluable, PsyIterable<PsyInteger>, PsyLengthy, PsyObject, PsyScalar<PsyTextual>, PsySequential<PsyInteger>, PsyStreamable<PsyInteger>, PsyTextual, PsyValue, Comparable<PsyTextual>, Iterable<PsyInteger>
Direct Known Subclasses:
PsyName

@Type("string") public class PsyString extends Object implements PsyTextual, PsyValue, PsyConcatenable<PsyString>
The representation of string, an immutable string.
  • Constructor Details

    • PsyString

      public PsyString(CharSequence cs)
      Instantiate a new string object from the given value.
      Parameters:
      cs - a given value.
    • PsyString

      public PsyString(PsyTextual oTextual)
      Instantiate a new string object from the value given as textual object.
      Parameters:
      oTextual - a textual object.
  • Method Details

    • stringValue

      public String stringValue()
      Returns a string value of this object.
      Specified by:
      stringValue in interface PsyTextual
      Returns:
      a string value of this object
    • psyToStringBuffer

      public PsyStringBuffer psyToStringBuffer()
      Description copied from interface: PsyObject
      Returns a stringbuffer representing this object.
      Specified by:
      psyToStringBuffer in interface PsyObject
      Returns:
      a stringbuffer representing this object
    • psyLength

      public PsyInteger psyLength()
      Description copied from interface: PsyLengthy
      Returns an integer representing the length of this object.
      Specified by:
      psyLength in interface PsyLengthy
      Returns:
      an integer length (in characters) of this string.
    • psyConcat

      public PsyString psyConcat(PsyString oString)
      Description copied from interface: PsyConcatenable
      Returns the concatenable result of concatenation of this object and specified object.
      Specified by:
      psyConcat in interface PsyConcatenable<PsyString>
      Parameters:
      oString - the specified object.
      Returns:
      the concatenable result of concatenation of this object and specified object
    • psyUpperCase

      public PsyString psyUpperCase()
      Converts all of the characters in this object to upper case according to default locale and returns a new string object representing the result of the conversion.
      Specified by:
      psyUpperCase in interface PsyTextual
      Returns:
      a string result of upper-casing.
    • psyLowerCase

      public PsyString psyLowerCase()
      Converts all of the characters in this object to lower case according to default locale and returns a new string object representing the result of the conversion.
      Specified by:
      psyLowerCase in interface PsyTextual
      Returns:
      a string result of lower-casing.
    • toSyntaxString

      public String toSyntaxString()
      Returns a syntactic representation of this object’s value. Returns a value string prepended with /.
      Specified by:
      toSyntaxString in interface PsyObject
      Returns:
      a syntactic representation of this object’s value
    • equals

      public boolean equals(Object object)
      Returns a boolean object indicating whether some other object is “equal to” this one. Return value is true if and only if other object has string type and its value is equal to this one’s.
      Overrides:
      equals in class Object
      Returns:
      a boolean object indicating whether some other object is “equal to” this one
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • parseLiteral

      public static PsyString parseLiteral(String image) throws PsySyntaxErrorException
      Throws:
      PsySyntaxErrorException