Package coneforest.psylla.core
Class PsyString
- java.lang.Object
-
- coneforest.psylla.core.PsyString
-
- All Implemented Interfaces:
PsyAppendable<PsyInteger>
,PsyArraylike<PsyInteger>
,PsyClearable
,PsyContainer<PsyInteger>
,PsyConvertableToInteger
,PsyConvertableToName
,PsyConvertableToReal
,PsyConvertableToString
,PsyEvaluable
,PsyIndexed<PsyInteger,PsyInteger>
,PsyIterable<PsyInteger>
,PsyLengthy
,PsyObject
,PsyScalar<PsyStringy>
,PsyStreamlike<PsyInteger>
,PsyStringy
,Iterable<PsyInteger>
public class PsyString extends Object implements PsyStringy, PsyArraylike<PsyInteger>
An implementation of Ψ-string
object.
-
-
Constructor Summary
Constructors Constructor Description PsyString()
Creates a new empty Ψ-string
.PsyString(String string)
Creates a new Ψ-string
whose buffer is initialized from string.PsyString(StringBuilder buffer)
Creates a new Ψ-string
with the supplied buffer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete(int index)
boolean
equals(Object object)
PsyInteger
extract(int index)
PsyInteger
get(int index)
StringBuilder
getBuffer()
Returns the buffer.int
hashCode()
void
insert(int index, PsyInteger oCharacter)
Inserts the specified Ψ-object
into this array at the position specified by a given index.int
length()
Returns a length of this object.void
psyAppend(PsyInteger oCharacter)
Appends a given Ψ-object
to this container.void
psyClear()
Clear this object.PsyString
psyClone()
Returns a clone of this object.PsyString
psyExtractInterval(PsyInteger oStart, PsyInteger oLength)
PsyString
psyGetInterval(PsyInteger oIndex, PsyInteger oCount)
void
psyInsertAll(PsyInteger oIndex, PsyIterable<? extends PsyInteger> oIterable)
PsyString
psyLowerCase()
void
psyPutInterval(PsyInteger oIndex, PsyIterable<? extends PsyInteger> oIterable)
PsyString
psyReverse()
void
psySetLength(PsyInteger oLength)
PsyString
psySlice(PsyIterable<PsyInteger> oIndices)
Returns a container of the same type as this object consisting of keys or indices from given Ψ-iterable
and of associated values.PsyStream
psyStream()
PsyString
psyToString()
Returns a Ψ-string
representing this object.PsyString
psyUpperCase()
void
put(int index, PsyInteger oCharacter)
String
stringValue()
Returns a string value of this object.String
toSyntaxString()
-
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface coneforest.psylla.core.PsyAppendable
psyAppendAll
-
Methods inherited from interface coneforest.psylla.core.PsyArraylike
psyCount, psyDelete, psyEntries, psyExtract, psyGet, psyGetAll, psyInsert, psyKeys, psyKnown, psyPostChop, psyPreChop, psyPrepend, psyPrependAll, psyPut, psyReplicate, psyValues, toSyntaxStringHelper
-
Methods inherited from interface coneforest.psylla.core.PsyContainer
psyNewEmpty
-
Methods inherited from interface coneforest.psylla.core.PsyIterable
psyFilter, psyForAll, psyMap, 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.PsyStreamlike
psyConcat
-
-
-
-
Constructor Detail
-
PsyString
public PsyString()
Creates a new empty Ψ-string
.
-
PsyString
public PsyString(String string)
Creates a new Ψ-string
whose buffer is initialized from string.- Parameters:
string
- a string.
-
PsyString
public PsyString(StringBuilder buffer)
Creates a new Ψ-string
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:PsyObject
Returns a Ψ-string
representing this object.- Specified by:
psyToString
in interfacePsyConvertableToString
- Specified by:
psyToString
in interfacePsyObject
- Returns:
- a Ψ-
string
representing this object.
-
stringValue
public String stringValue()
Description copied from interface:PsyStringy
Returns a string value of this object.- Specified by:
stringValue
in interfacePsyStringy
- Returns:
- a string value.
-
psyClone
public PsyString psyClone()
Description copied from interface:PsyObject
Returns a clone of this object.- Specified by:
psyClone
in interfacePsyArraylike<PsyInteger>
- Specified by:
psyClone
in interfacePsyObject
- Returns:
- a clone of this object.
-
get
public PsyInteger get(int index) throws PsyException
- Specified by:
get
in interfacePsyArraylike<PsyInteger>
- Throws:
PsyException
-
psyGetInterval
public PsyString psyGetInterval(PsyInteger oIndex, PsyInteger oCount) throws PsyException
- Specified by:
psyGetInterval
in interfacePsyArraylike<PsyInteger>
- Throws:
PsyException
-
put
public void put(int index, PsyInteger oCharacter) throws PsyException
- Specified by:
put
in interfacePsyArraylike<PsyInteger>
- Throws:
PsyException
-
psyPutInterval
public void psyPutInterval(PsyInteger oIndex, PsyIterable<? extends PsyInteger> oIterable) throws PsyException
- Specified by:
psyPutInterval
in interfacePsyArraylike<PsyInteger>
- Throws:
PsyException
-
psyAppend
public void psyAppend(PsyInteger oCharacter) throws PsyLimitCheckException
Description copied from interface:PsyAppendable
Appends a given Ψ-object
to this container.- Specified by:
psyAppend
in interfacePsyAppendable<PsyInteger>
- Parameters:
oCharacter
- a given Ψ-object
to append.- Throws:
PsyLimitCheckException
-
insert
public void insert(int index, PsyInteger oCharacter) throws PsyException
Description copied from interface:PsyArraylike
Inserts the specified Ψ-object
into this array at the position specified by a given index.- Specified by:
insert
in interfacePsyArraylike<PsyInteger>
- Parameters:
index
- a Ψ-integer
index.oCharacter
- a Ψ-object
.- Throws:
PsyException
- when an error occurs.
-
psyInsertAll
public void psyInsertAll(PsyInteger oIndex, PsyIterable<? extends PsyInteger> oIterable) throws PsyException
- Specified by:
psyInsertAll
in interfacePsyArraylike<PsyInteger>
- Throws:
PsyException
-
delete
public void delete(int index) throws PsyException
- Specified by:
delete
in interfacePsyArraylike<PsyInteger>
- Throws:
PsyException
-
extract
public PsyInteger extract(int index) throws PsyException
- Specified by:
extract
in interfacePsyArraylike<PsyInteger>
- Throws:
PsyException
-
psyExtractInterval
public PsyString psyExtractInterval(PsyInteger oStart, PsyInteger oLength) throws PsyException
- Specified by:
psyExtractInterval
in interfacePsyArraylike<PsyInteger>
- Throws:
PsyException
-
psySlice
public PsyString psySlice(PsyIterable<PsyInteger> oIndices) throws PsyException
Description copied from interface:PsyIndexed
Returns a container of the same type as this object consisting of keys or indices from given Ψ-iterable
and of associated values.- Specified by:
psySlice
in interfacePsyArraylike<PsyInteger>
- Specified by:
psySlice
in 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:
psySetLength
in interfacePsyArraylike<PsyInteger>
- Throws:
PsyException
-
psyClear
public void psyClear()
Description copied from interface:PsyClearable
Clear this object.- Specified by:
psyClear
in interfacePsyClearable
-
psyReverse
public PsyString psyReverse()
- Specified by:
psyReverse
in interfacePsyArraylike<PsyInteger>
-
psyUpperCase
public PsyString psyUpperCase()
- Specified by:
psyUpperCase
in interfacePsyStringy
-
psyLowerCase
public PsyString psyLowerCase()
- Specified by:
psyLowerCase
in interfacePsyStringy
-
length
public int length()
Description copied from interface:PsyLengthy
Returns a length of this object.- Specified by:
length
in interfacePsyLengthy
- Specified by:
length
in interfacePsyStringy
- Returns:
- a length.
-
toSyntaxString
public String toSyntaxString()
- Specified by:
toSyntaxString
in interfacePsyArraylike<PsyInteger>
- Specified by:
toSyntaxString
in interfacePsyObject
-
psyStream
public PsyStream psyStream()
- Specified by:
psyStream
in interfacePsyIterable<PsyInteger>
-
-