Package coneforest.psylla.core
Class PsyString
- java.lang.Object
-
- coneforest.psylla.core.PsyString
-
- All Implemented Interfaces:
PsyAppendable<PsyInteger>,PsyClearable,PsyContainer<PsyInteger>,PsyConvertableToInteger,PsyConvertableToName,PsyConvertableToReal,PsyConvertableToString,PsyEvaluable,PsyFormalArray<PsyInteger>,PsyIndexed<PsyInteger,PsyInteger>,PsyIterable<PsyInteger>,PsyLengthy,PsyObject,PsyScalar<PsyTextual>,PsySequential<PsyInteger>,PsyStreamable<PsyInteger>,PsyTextual,Iterable<PsyInteger>
public class PsyString extends Object implements PsyTextual, PsyFormalArray<PsyInteger>
An implementation of Ψ-stringobject.
-
-
Field Summary
Fields Modifier and Type Field Description static PsyOperator[]OPERATORS
-
Constructor Summary
Constructors Constructor Description PsyString()Creates a new empty Ψ-string.PsyString(String string)Creates a new Ψ-stringwhose buffer is initialized from string.PsyString(StringBuilder buffer)Creates a new Ψ-stringwith the supplied buffer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(int index)booleanequals(Object object)PsyIntegerextract(int index)PsyIntegerget(int index)StringBuildergetBuffer()Returns the buffer.inthashCode()voidinsert(int index, PsyInteger oCharacter)Inserts the specified Ψ-objectinto this array at the position specified by a given index.intlength()Returns a length of this object.voidpsyAppend(PsyInteger oCharacter)Appends a given Ψ-objectto this container.voidpsyClear()Clear this object.PsyStringpsyClone()Returns a clone of this object.PsyStringpsyExtractInterval(PsyInteger oStart, PsyInteger oLength)PsyStringpsyGetInterval(PsyInteger oIndex, PsyInteger oCount)voidpsyInsertAll(PsyInteger oIndex, PsyIterable<? extends PsyInteger> oIterable)PsyStringpsyLowerCase()voidpsyPutInterval(PsyInteger oIndex, PsyIterable<? extends PsyInteger> oIterable)PsyStringpsyReverse()voidpsySetLength(PsyInteger oLength)PsyStringpsySlice(PsyIterable<PsyInteger> oIndices)Returns a container of the same type as this object consisting of keys or indices from given Ψ-iterableand of associated values.PsyStringpsyToString()Returns a Ψ-stringrepresenting this object.PsyStringpsyUpperCase()voidput(int index, PsyInteger oCharacter)StringstringValue()Returns a string value of this object.StringtoSyntaxString()-
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, psyGetAll, psyInsert, psyKeys, psyKnown, psyPostChop, psyPreChop, psyPrepend, psyPrependAll, psyPut, psyReplicate, psyValues, toSyntaxStringHelper
-
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.PsyStreamable
psyForAll
-
Methods inherited from interface coneforest.psylla.core.PsyTextual
iterator, psyCmp, psyEq, psyEval, psyGe, psyGt, psyIndexOfChar, psyIndexOfSubstring, psyLe, psyLt, psySplit, psyToInteger, psyToName, psyToReal
-
-
-
-
Field Detail
-
OPERATORS
public static final PsyOperator[] OPERATORS
-
-
Constructor Detail
-
PsyString
public PsyString()
Creates a new empty Ψ-string.
-
PsyString
public PsyString(String string)
Creates a new Ψ-stringwhose buffer is initialized from string.- Parameters:
string- a string.
-
PsyString
public PsyString(StringBuilder buffer)
Creates a new Ψ-stringwith the supplied buffer.- Parameters:
buffer- a buffer.
-
-
Method Detail
-
getBuffer
public StringBuilder getBuffer()
Returns the buffer.- Returns:
- a buffer.
-
psyToString
public PsyString psyToString()
Description copied from interface:PsyObjectReturns a Ψ-stringrepresenting this object.- Specified by:
psyToStringin interfacePsyConvertableToString- Specified by:
psyToStringin interfacePsyObject- Returns:
- a Ψ-
stringrepresenting this object.
-
stringValue
public String stringValue()
Description copied from interface:PsyTextualReturns a string value of this object.- Specified by:
stringValuein interfacePsyTextual- Returns:
- a string value.
-
psyClone
public PsyString psyClone()
Description copied from interface:PsyObjectReturns a clone of this object.- Specified by:
psyClonein interfacePsyFormalArray<PsyInteger>- Specified by:
psyClonein interfacePsyObject- Returns:
- a clone of this object.
-
get
public PsyInteger get(int index) throws PsyException
- Specified by:
getin interfacePsyFormalArray<PsyInteger>- Throws:
PsyException
-
psyGetInterval
public PsyString psyGetInterval(PsyInteger oIndex, PsyInteger oCount) throws PsyException
- Specified by:
psyGetIntervalin interfacePsyFormalArray<PsyInteger>- Throws:
PsyException
-
put
public void put(int index, PsyInteger oCharacter) throws PsyException- Specified by:
putin interfacePsyFormalArray<PsyInteger>- Throws:
PsyException
-
psyPutInterval
public void psyPutInterval(PsyInteger oIndex, PsyIterable<? extends PsyInteger> oIterable) throws PsyException
- Specified by:
psyPutIntervalin interfacePsyFormalArray<PsyInteger>- Throws:
PsyException
-
psyAppend
public void psyAppend(PsyInteger oCharacter) throws PsyLimitCheckException
Description copied from interface:PsyAppendableAppends a given Ψ-objectto this container.- Specified by:
psyAppendin interfacePsyAppendable<PsyInteger>- Parameters:
oCharacter- a given Ψ-objectto append.- Throws:
PsyLimitCheckException
-
insert
public void insert(int index, PsyInteger oCharacter) throws PsyExceptionDescription copied from interface:PsyFormalArrayInserts the specified Ψ-objectinto this array at the position specified by a given index.- Specified by:
insertin interfacePsyFormalArray<PsyInteger>- Parameters:
index- a Ψ-integerindex.oCharacter- a Ψ-object.- Throws:
PsyException- when an error occurs.
-
psyInsertAll
public void psyInsertAll(PsyInteger oIndex, PsyIterable<? extends PsyInteger> oIterable) throws PsyException
- Specified by:
psyInsertAllin interfacePsyFormalArray<PsyInteger>- Throws:
PsyException
-
delete
public void delete(int index) throws PsyException- Specified by:
deletein interfacePsyFormalArray<PsyInteger>- Throws:
PsyException
-
extract
public PsyInteger extract(int index) throws PsyException
- Specified by:
extractin interfacePsyFormalArray<PsyInteger>- Throws:
PsyException
-
psyExtractInterval
public PsyString psyExtractInterval(PsyInteger oStart, PsyInteger oLength) throws PsyException
- Specified by:
psyExtractIntervalin interfacePsyFormalArray<PsyInteger>- Throws:
PsyException
-
psySlice
public PsyString psySlice(PsyIterable<PsyInteger> oIndices) throws PsyException
Description copied from interface:PsyIndexedReturns a container of the same type as this object consisting of keys or indices from given Ψ-iterableand of associated values.- Specified by:
psySlicein interfacePsyFormalArray<PsyInteger>- Specified by:
psySlicein interfacePsyIndexed<PsyInteger,PsyInteger>- Parameters:
oIndices- an enumeration of keys.- Returns:
- a container.
- Throws:
PsyException- when key is absent or index is out of range.
-
psySetLength
public void psySetLength(PsyInteger oLength) throws PsyException
- Specified by:
psySetLengthin interfacePsyFormalArray<PsyInteger>- Throws:
PsyException
-
psyClear
public void psyClear()
Description copied from interface:PsyClearableClear this object.- Specified by:
psyClearin interfacePsyClearable
-
psyReverse
public PsyString psyReverse()
- Specified by:
psyReversein interfacePsyFormalArray<PsyInteger>
-
psyUpperCase
public PsyString psyUpperCase()
- Specified by:
psyUpperCasein interfacePsyTextual
-
psyLowerCase
public PsyString psyLowerCase()
- Specified by:
psyLowerCasein interfacePsyTextual
-
length
public int length()
Description copied from interface:PsyLengthyReturns a length of this object.- Specified by:
lengthin interfacePsyLengthy- Specified by:
lengthin interfacePsyTextual- Returns:
- a length.
-
toSyntaxString
public String toSyntaxString()
- Specified by:
toSyntaxStringin interfacePsyFormalArray<PsyInteger>- Specified by:
toSyntaxStringin interfacePsyObject
-
-