java.lang.Object
coneforest.psylla.core.PsyString
- All Implemented Interfaces:
PsyAppendable<PsyInteger>
,PsyClearable
,PsyContainer<PsyInteger>
,PsyConvertableToInteger
,PsyConvertableToIntegral
,PsyConvertableToReal
,PsyEvaluable
,PsyFormalArray<PsyInteger>
,PsyIndexed<PsyInteger,
,PsyInteger> PsyIterable<PsyInteger>
,PsyLengthy
,PsyObject
,PsyScalar<PsyTextual>
,PsySequential<PsyInteger>
,PsyStreamable<PsyInteger>
,PsyTextual
,Comparable<PsyTextual>
,Iterable<PsyInteger>
@Type("string")
public class PsyString
extends Object
implements PsyTextual, PsyFormalArray<PsyInteger>
An implementation of
string
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ContextAction
Context action of thestring
operator.Fields inherited from interface coneforest.psylla.core.PsyAppendable
PSY_APPEND, PSY_APPENDALL
Fields inherited from interface coneforest.psylla.core.PsyClearable
PSY_CLEAR
Fields inherited from interface coneforest.psylla.core.PsyConvertableToInteger
PSY_TOINTEGER
Fields inherited from interface coneforest.psylla.core.PsyConvertableToIntegral
PSY_TOINTEGRAL
Fields inherited from interface coneforest.psylla.core.PsyConvertableToReal
PSY_TOREAL
Fields inherited from interface coneforest.psylla.core.PsyEvaluable
PSY_EVAL
Fields inherited from interface coneforest.psylla.core.PsyFormalArray
PSY_EXTRACTINTERVAL, PSY_GETINTERVAL, PSY_INSERT, PSY_INSERTALL, PSY_POSTCHOP, PSY_PRECHOP, PSY_PREPEND, PSY_PREPENDALL, PSY_PUTINTERVAL, PSY_REVERSE, PSY_SETLENGTH
Fields inherited from interface coneforest.psylla.core.PsyIndexed
PSY_DELETE, PSY_ENTRIES, PSY_EXTRACT, PSY_GET, PSY_GETALL, PSY_KEYS, PSY_KNOWN, PSY_PUT, PSY_SLICE, PSY_VALUES
Fields inherited from interface coneforest.psylla.core.PsyLengthy
PSY_ISEMPTY, PSY_LENGTH
Fields inherited from interface coneforest.psylla.core.PsyObject
PSY_CLONE, PSY_EQ, PSY_HASHCODE, PSY_INSTANCEOF, PSY_NE, PSY_TONAME, PSY_TOSTRING, PSY_TYPE
Fields inherited from interface coneforest.psylla.core.PsyScalar
PSY_CMP, PSY_GE, PSY_GT, PSY_LE, PSY_LT, PSY_MAX, PSY_MIN
Fields inherited from interface coneforest.psylla.core.PsySequential
PSY_FORALL
Fields inherited from interface coneforest.psylla.core.PsyStreamable
PSY_STREAM
Fields inherited from interface coneforest.psylla.core.PsyTextual
PSY_INDEXOFCHAR, PSY_INDEXOFSUBSTRING, PSY_LOWERCASE, PSY_SPLIT, PSY_UPPERCASE
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new emptystring
object.Creates a newstring
object whose buffer is initialized from string.PsyString
(StringBuilder buffer) Creates a newstring
object with the supplied buffer. -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(int index) Removes the element at the specified position in this array.boolean
extract
(int index) get
(int index) Returns the element at the specified position in this array.Returns the buffer.int
hashCode()
void
insert
(int index, PsyInteger oCharacter) Inserts the specifiedobject
into this array at the position specified by a given index.int
length()
Returns a length of this object.static PsyString
parseLiteral
(String image) void
psyAppend
(PsyInteger oCharacter) Appends a givenobject
to this container.void
psyClear()
Clear this object.psyClone()
Returns a clone of this object.psyExtractInterval
(PsyInteger oStart, PsyInteger oLength) psyGetInterval
(PsyInteger oIndex, PsyInteger oCount) void
psyInsertAll
(PsyInteger oIndex, PsyIterable<? extends PsyInteger> oIterable) void
psyPutInterval
(PsyInteger oIndex, PsyIterable<? extends PsyInteger> oIterable) void
psySetLength
(PsyInteger oLength) psySlice
(PsyIterable<PsyInteger> oIndices) Returns a container of the same type as this object consisting of keys or indices from giveniterable
and of associated values.Returns astring
representing this object.void
put
(int index, PsyInteger oCharacter) Returns a string value of this object.Returns the syntactic representation of this object.Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface coneforest.psylla.core.PsyAppendable
psyAppendAll
Methods inherited from interface coneforest.psylla.core.PsyContainer
psyNewEmpty
Methods inherited from interface coneforest.psylla.core.PsyFormalArray
psyDelete, psyEntries, psyExtract, psyGet, psyInsert, psyKeys, psyKnown, psyPostChop, psyPreChop, psyPrepend, psyPrependAll, psyPut, psyReplicate, psyValues, toSyntaxStringHelper
Methods inherited from interface coneforest.psylla.core.PsyIndexed
psyGetAll
Methods inherited from interface coneforest.psylla.core.PsyIterable
psyStream, psyToArray, psyUnite
Methods inherited from interface coneforest.psylla.core.PsyLengthy
isEmpty, psyIsEmpty, psyLength
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyType, typeName
Methods inherited from interface coneforest.psylla.core.PsyScalar
psyCmp, psyGe, psyGt, psyLe, psyLt, psyMax, psyMin
Methods inherited from interface coneforest.psylla.core.PsyStreamable
psyForAll
Methods inherited from interface coneforest.psylla.core.PsyTextual
compareTo, iterator, psyEq, psyEval, psyIndexOfChar, psyIndexOfSubstring, psySplit, psyToInteger, psyToIntegral, psyToName, psyToReal
-
Field Details
-
PSY_STRING
Context action of thestring
operator.
-
-
Constructor Details
-
PsyString
public PsyString()Creates a new emptystring
object. -
PsyString
Creates a newstring
object whose buffer is initialized from string.- Parameters:
string
- a string.
-
PsyString
Creates a newstring
object with the supplied buffer.- Parameters:
buffer
- a buffer.
-
-
Method Details
-
getBuffer
Returns the buffer.- Returns:
- a buffer.
-
psyToString
Description copied from interface:PsyObject
Returns astring
representing this object.- Specified by:
psyToString
in interfacePsyObject
- Returns:
- a
string
representing this object.
-
stringValue
Description copied from interface:PsyTextual
Returns a string value of this object.- Specified by:
stringValue
in interfacePsyTextual
- Returns:
- a string value.
-
psyClone
Description copied from interface:PsyObject
Returns a clone of this object.- Specified by:
psyClone
in interfacePsyFormalArray<PsyInteger>
- Specified by:
psyClone
in interfacePsyObject
- Returns:
- a clone of this object.
-
get
Description copied from interface:PsyFormalArray
Returns the element at the specified position in this array.- Specified by:
get
in interfacePsyFormalArray<PsyInteger>
- Parameters:
index
- the index of the element.- Returns:
- the element at the specified position in this list.
- Throws:
PsyRangeCheckException
- if the index is out of range.
-
psyGetInterval
- Specified by:
psyGetInterval
in interfacePsyFormalArray<PsyInteger>
- Throws:
PsyRangeCheckException
-
put
- Specified by:
put
in interfacePsyFormalArray<PsyInteger>
- Throws:
PsyRangeCheckException
-
psyPutInterval
public void psyPutInterval(PsyInteger oIndex, PsyIterable<? extends PsyInteger> oIterable) throws PsyRangeCheckException - Specified by:
psyPutInterval
in interfacePsyFormalArray<PsyInteger>
- Throws:
PsyRangeCheckException
-
psyAppend
Description copied from interface:PsyAppendable
Appends a givenobject
to this container.- Specified by:
psyAppend
in interfacePsyAppendable<PsyInteger>
- Parameters:
oCharacter
- anobject
to append.- Throws:
PsyLimitCheckException
- when TODO.
-
insert
Description copied from interface:PsyFormalArray
Inserts the specifiedobject
into this array at the position specified by a given index.- Specified by:
insert
in interfacePsyFormalArray<PsyInteger>
- Parameters:
index
- ainteger
index.oCharacter
- aobject
.- Throws:
PsyRangeCheckException
- when TODO.
-
psyInsertAll
public void psyInsertAll(PsyInteger oIndex, PsyIterable<? extends PsyInteger> oIterable) throws PsyRangeCheckException - Specified by:
psyInsertAll
in interfacePsyFormalArray<PsyInteger>
- Throws:
PsyRangeCheckException
-
delete
Description copied from interface:PsyFormalArray
Removes the element at the specified position in this array.- Specified by:
delete
in interfacePsyFormalArray<PsyInteger>
- Parameters:
index
- the index of the element to be removed.- Throws:
PsyRangeCheckException
- if the index is out of range.
-
extract
- Specified by:
extract
in interfacePsyFormalArray<PsyInteger>
- Throws:
PsyRangeCheckException
-
psyExtractInterval
public PsyString psyExtractInterval(PsyInteger oStart, PsyInteger oLength) throws PsyRangeCheckException - Specified by:
psyExtractInterval
in interfacePsyFormalArray<PsyInteger>
- Throws:
PsyRangeCheckException
-
psySlice
public PsyString psySlice(PsyIterable<PsyInteger> oIndices) throws PsyRangeCheckException, PsyLimitCheckException Description copied from interface:PsyIndexed
Returns a container of the same type as this object consisting of keys or indices from giveniterable
and of associated values.- Specified by:
psySlice
in interfacePsyFormalArray<PsyInteger>
- Specified by:
psySlice
in interfacePsyIndexed<PsyInteger,
PsyInteger> - Parameters:
oIndices
- an enumeration of keys.- Returns:
- a container.
- Throws:
PsyRangeCheckException
- when the index is out of range.PsyLimitCheckException
- when TODO
-
psySetLength
- Specified by:
psySetLength
in interfacePsyFormalArray<PsyInteger>
- Throws:
PsyLimitCheckException
PsyRangeCheckException
-
psyClear
public void psyClear()Description copied from interface:PsyClearable
Clear this object.- Specified by:
psyClear
in interfacePsyClearable
-
psyReverse
- Specified by:
psyReverse
in interfacePsyFormalArray<PsyInteger>
-
psyUpperCase
- Specified by:
psyUpperCase
in interfacePsyTextual
-
psyLowerCase
- Specified by:
psyLowerCase
in interfacePsyTextual
-
length
public int length()Description copied from interface:PsyLengthy
Returns a length of this object.- Specified by:
length
in interfacePsyLengthy
- Specified by:
length
in interfacePsyTextual
- Returns:
- a length.
-
equals
-
hashCode
public int hashCode() -
toSyntaxString
Description copied from interface:PsyObject
Returns the syntactic representation of this object.- Specified by:
toSyntaxString
in interfacePsyFormalArray<PsyInteger>
- Specified by:
toSyntaxString
in interfacePsyObject
- Returns:
- the syntactic representation of this object.
-
parseLiteral
- Throws:
PsySyntaxErrorException
-