Package coneforest.psylla.core
Class PsyString
- java.lang.Object
-
- coneforest.psylla.core.PsyString
-
- All Implemented Interfaces:
PsyAppendable<PsyInteger>,PsyClearable,PsyContainer<PsyInteger>,PsyConvertableToInteger,PsyConvertableToIntegral,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 ofstringobject.
-
-
Field Summary
Fields Modifier and Type Field Description static PsyOperator[]OPERATORS
-
Constructor Summary
Constructors Constructor Description PsyString()Creates a new emptystringobject.PsyString(String string)Creates a newstringobject whose buffer is initialized from string.PsyString(StringBuilder buffer)Creates a newstringobject with 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 specifiedobjectinto this array at the position specified by a given index.intlength()Returns a length of this object.voidpsyAppend(PsyInteger oCharacter)Appends a givenobjectto 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 giveniterableand of associated values.PsyStringpsyToString()Returns astringrepresenting 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, psyToIntegral, psyToName, psyToReal
-
-
-
-
Field Detail
-
OPERATORS
public static final PsyOperator[] OPERATORS
-
-
Constructor Detail
-
PsyString
public PsyString()
Creates a new emptystringobject.
-
PsyString
public PsyString(String string)
Creates a newstringobject whose buffer is initialized from string.- Parameters:
string- a string.
-
PsyString
public PsyString(StringBuilder buffer)
Creates a newstringobject with 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 astringrepresenting 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 PsyErrorException
- Specified by:
getin interfacePsyFormalArray<PsyInteger>- Throws:
PsyErrorException
-
psyGetInterval
public PsyString psyGetInterval(PsyInteger oIndex, PsyInteger oCount) throws PsyErrorException
- Specified by:
psyGetIntervalin interfacePsyFormalArray<PsyInteger>- Throws:
PsyErrorException
-
put
public void put(int index, PsyInteger oCharacter) throws PsyErrorException- Specified by:
putin interfacePsyFormalArray<PsyInteger>- Throws:
PsyErrorException
-
psyPutInterval
public void psyPutInterval(PsyInteger oIndex, PsyIterable<? extends PsyInteger> oIterable) throws PsyErrorException
- Specified by:
psyPutIntervalin interfacePsyFormalArray<PsyInteger>- Throws:
PsyErrorException
-
psyAppend
public void psyAppend(PsyInteger oCharacter) throws PsyLimitCheckException
Description copied from interface:PsyAppendableAppends a givenobjectto this container.- Specified by:
psyAppendin interfacePsyAppendable<PsyInteger>- Parameters:
oCharacter- anobjectto append.- Throws:
PsyLimitCheckException
-
insert
public void insert(int index, PsyInteger oCharacter) throws PsyErrorExceptionDescription copied from interface:PsyFormalArrayInserts the specifiedobjectinto this array at the position specified by a given index.- Specified by:
insertin interfacePsyFormalArray<PsyInteger>- Parameters:
index- aintegerindex.oCharacter- aobject.- Throws:
PsyErrorException- when an error occurs.
-
psyInsertAll
public void psyInsertAll(PsyInteger oIndex, PsyIterable<? extends PsyInteger> oIterable) throws PsyErrorException
- Specified by:
psyInsertAllin interfacePsyFormalArray<PsyInteger>- Throws:
PsyErrorException
-
delete
public void delete(int index) throws PsyErrorException- Specified by:
deletein interfacePsyFormalArray<PsyInteger>- Throws:
PsyErrorException
-
extract
public PsyInteger extract(int index) throws PsyErrorException
- Specified by:
extractin interfacePsyFormalArray<PsyInteger>- Throws:
PsyErrorException
-
psyExtractInterval
public PsyString psyExtractInterval(PsyInteger oStart, PsyInteger oLength) throws PsyErrorException
- Specified by:
psyExtractIntervalin interfacePsyFormalArray<PsyInteger>- Throws:
PsyErrorException
-
psySlice
public PsyString psySlice(PsyIterable<PsyInteger> oIndices) throws PsyErrorException
Description copied from interface:PsyIndexedReturns a container of the same type as this object consisting of keys or indices from giveniterableand of associated values.- Specified by:
psySlicein interfacePsyFormalArray<PsyInteger>- Specified by:
psySlicein interfacePsyIndexed<PsyInteger,PsyInteger>- Parameters:
oIndices- an enumeration of keys.- Returns:
- a container.
- Throws:
PsyErrorException- when key is absent or index is out of range.
-
psySetLength
public void psySetLength(PsyInteger oLength) throws PsyErrorException
- Specified by:
psySetLengthin interfacePsyFormalArray<PsyInteger>- Throws:
PsyErrorException
-
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
-
-