java.lang.Object
coneforest.psylla.core.PsyArray
- All Implemented Interfaces:
PsyAppendable<PsyObject>
,PsyClearable
,PsyContainer<PsyObject>
,PsyFormalArray<PsyObject>
,PsyIndexed<PsyInteger,
,PsyObject> PsyIterable<PsyObject>
,PsyLengthy
,PsyObject
,PsySequential<PsyObject>
,PsyStreamable<PsyObject>
,Iterable<PsyObject>
- Direct Known Subclasses:
PsyProc
The representation of
array
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ContextAction
Context action of thearray
operator.static final ContextAction
Context action of thearraytomark
operator.static final ContextAction
Context action of thebinarysearch
operator.static final ContextAction
Context action of thesort
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.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.PsySequential
PSY_FORALL
Fields inherited from interface coneforest.psylla.core.PsyStreamable
PSY_STREAM
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(int indexValue) Removes the element at the specified position in this array.extract
(int indexValue) get
(int index) Returns the element at the specified position in this array.void
Inserts the specifiedobject
into this array at the position specified by a given index.iterator()
int
length()
Returns a length of this object.void
Appends a givenobject
to this container.psyBinarySearch
(PsyObject o, PsyProc oComparator, PsyContext oContext) Searches this array for the specified value using the binary search algorithm.void
psyClear()
Clear this object.psyClone()
Returns a clone of this object.psyExtractInterval
(PsyInteger oStart, PsyInteger oCount) psyGetInterval
(PsyInteger oStart, PsyInteger oCount) 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.void
psySort
(PsyProc oComparator, PsyContext oContext) Sorts this list according to the order induced by the specified comparator.void
Methods inherited from class java.lang.Object
equals, getClass, hashCode, 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, psyInsertAll, psyKeys, psyKnown, psyPostChop, psyPreChop, psyPrepend, psyPrependAll, psyPut, psyPutInterval, psyReplicate, psyReverse, psyValues, toSyntaxString, toSyntaxStringHelper
Methods inherited from interface coneforest.psylla.core.PsyIndexed
psyGetAll
Methods inherited from interface coneforest.psylla.core.PsyIterable
psyToArray, psyUnite
Methods inherited from interface coneforest.psylla.core.PsyLengthy
isEmpty, psyIsEmpty, psyLength
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, typeName
Methods inherited from interface coneforest.psylla.core.PsyStreamable
psyForAll
-
Field Details
-
PSY_ARRAY
Context action of thearray
operator. -
PSY_ARRAYTOMARK
Context action of thearraytomark
operator. -
PSY_BINARYSEARCH
Context action of thebinarysearch
operator. -
PSY_SORT
Context action of thesort
operator.
-
-
Constructor Details
-
PsyArray
public PsyArray()Constructs a new emptyarray
. -
PsyArray
Constructs a newarray
wrapped around the given array list.- Parameters:
array
- a given array list.
-
-
Method Details
-
length
public int length()Description copied from interface:PsyLengthy
Returns a length of this object.- Specified by:
length
in interfacePsyLengthy
- Returns:
- a length.
-
iterator
-
psyClone
Description copied from interface:PsyObject
Returns a clone of this object.- Specified by:
psyClone
in interfacePsyFormalArray<PsyObject>
- 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<PsyObject>
- 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<PsyObject>
- Throws:
PsyRangeCheckException
-
psyAppend
Description copied from interface:PsyAppendable
Appends a givenobject
to this container.- Specified by:
psyAppend
in interfacePsyAppendable<PsyObject>
- Parameters:
o
- 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<PsyObject>
- Parameters:
indexValue
- ainteger
index.o
- aobject
.- Throws:
PsyRangeCheckException
- when TODO.
-
put
- Specified by:
put
in interfacePsyFormalArray<PsyObject>
- Throws:
PsyRangeCheckException
-
delete
Description copied from interface:PsyFormalArray
Removes the element at the specified position in this array.- Specified by:
delete
in interfacePsyFormalArray<PsyObject>
- Parameters:
indexValue
- the index of the element to be removed.- Throws:
PsyRangeCheckException
- if the index is out of range.
-
extract
- Specified by:
extract
in interfacePsyFormalArray<PsyObject>
- Throws:
PsyRangeCheckException
-
psyExtractInterval
public PsyArray psyExtractInterval(PsyInteger oStart, PsyInteger oCount) throws PsyRangeCheckException - Specified by:
psyExtractInterval
in interfacePsyFormalArray<PsyObject>
- Throws:
PsyRangeCheckException
-
psySlice
public PsyArray 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<PsyObject>
- Specified by:
psySlice
in interfacePsyIndexed<PsyInteger,
PsyObject> - Parameters:
oIndices
- an enumeration of keys.- Returns:
- a container.
- Throws:
PsyRangeCheckException
- when the index is out of range.PsyLimitCheckException
- when TODO
-
psyClear
public void psyClear()Description copied from interface:PsyClearable
Clear this object.- Specified by:
psyClear
in interfacePsyClearable
-
psySetLength
- Specified by:
psySetLength
in interfacePsyFormalArray<PsyObject>
- Throws:
PsyRangeCheckException
PsyLimitCheckException
-
psySort
Sorts this list according to the order induced by the specified comparator. The sort is stable: this method must not reorder equal elements.- Parameters:
oComparator
- theproc
comparator used to compare array elements.oContext
- the execution context.
-
psyBinarySearch
Searches this array for the specified value using the binary search algorithm. The array must be sorted into ascending order according to the specified comparator. TODO- Parameters:
o
- the value to be searched for.oComparator
- the comparator by which the array is ordered.oContext
- the execution context.- Returns:
- TODO
-
psyStream
- Specified by:
psyStream
in interfacePsyIterable<PsyObject>
- Specified by:
psyStream
in interfacePsyStreamable<PsyObject>
-