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 ContextActionContext action of thearrayoperator.static final ContextActionContext action of thearraytomarkoperator.static final ContextActionContext action of thebinarysearchoperator.static final ContextActionContext action of thesortoperator.Fields inherited from interface coneforest.psylla.core.PsyAppendable
PSY_APPEND, PSY_APPENDALLFields inherited from interface coneforest.psylla.core.PsyClearable
PSY_CLEARFields 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_SETLENGTHFields 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_VALUESFields inherited from interface coneforest.psylla.core.PsyLengthy
PSY_ISEMPTY, PSY_LENGTHFields inherited from interface coneforest.psylla.core.PsyObject
PSY_CLONE, PSY_EQ, PSY_HASHCODE, PSY_INSTANCEOF, PSY_NE, PSY_TONAME, PSY_TOSTRING, PSY_TYPEFields inherited from interface coneforest.psylla.core.PsySequential
PSY_FORALLFields inherited from interface coneforest.psylla.core.PsyStreamable
PSY_STREAM -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(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.voidInserts the specifiedobjectinto this array at the position specified by a given index.iterator()intlength()Returns a length of this object.voidAppends a givenobjectto this container.psyBinarySearch(PsyObject o, PsyProc oComparator, PsyContext oContext) Searches this array for the specified value using the binary search algorithm.voidpsyClear()Clear this object.psyClone()Returns a clone of this object.psyExtractInterval(PsyInteger oStart, PsyInteger oCount) psyGetInterval(PsyInteger oStart, PsyInteger oCount) voidpsySetLength(PsyInteger oLength) psySlice(PsyIterable<PsyInteger> oIndices) Returns a container of the same type as this object consisting of keys or indices from giveniterableand of associated values.voidpsySort(PsyProc oComparator, PsyContext oContext) Sorts this list according to the order induced by the specified comparator.voidMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface coneforest.psylla.core.PsyAppendable
psyAppendAllMethods inherited from interface coneforest.psylla.core.PsyContainer
psyNewEmptyMethods 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, toSyntaxStringHelperMethods inherited from interface coneforest.psylla.core.PsyIndexed
psyGetAllMethods inherited from interface coneforest.psylla.core.PsyIterable
psyToArray, psyUniteMethods inherited from interface coneforest.psylla.core.PsyLengthy
isEmpty, psyIsEmpty, psyLengthMethods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, typeNameMethods inherited from interface coneforest.psylla.core.PsyStreamable
psyForAll
-
Field Details
-
PSY_ARRAY
Context action of thearrayoperator. -
PSY_ARRAYTOMARK
Context action of thearraytomarkoperator. -
PSY_BINARYSEARCH
Context action of thebinarysearchoperator. -
PSY_SORT
Context action of thesortoperator.
-
-
Constructor Details
-
PsyArray
public PsyArray()Constructs a new emptyarray. -
PsyArray
Constructs a newarraywrapped around the given array list.- Parameters:
array- a given array list.
-
-
Method Details
-
length
public int length()Description copied from interface:PsyLengthyReturns a length of this object.- Specified by:
lengthin interfacePsyLengthy- Returns:
- a length.
-
iterator
-
psyClone
Description copied from interface:PsyObjectReturns a clone of this object.- Specified by:
psyClonein interfacePsyFormalArray<PsyObject>- Specified by:
psyClonein interfacePsyObject- Returns:
- a clone of this object.
-
get
Description copied from interface:PsyFormalArrayReturns the element at the specified position in this array.- Specified by:
getin 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:
psyGetIntervalin interfacePsyFormalArray<PsyObject>- Throws:
PsyRangeCheckException
-
psyAppend
Description copied from interface:PsyAppendableAppends a givenobjectto this container.- Specified by:
psyAppendin interfacePsyAppendable<PsyObject>- Parameters:
o- anobjectto append.- Throws:
PsyLimitCheckException- when TODO.
-
insert
Description copied from interface:PsyFormalArrayInserts the specifiedobjectinto this array at the position specified by a given index.- Specified by:
insertin interfacePsyFormalArray<PsyObject>- Parameters:
indexValue- aintegerindex.o- aobject.- Throws:
PsyRangeCheckException- when TODO.
-
put
- Specified by:
putin interfacePsyFormalArray<PsyObject>- Throws:
PsyRangeCheckException
-
delete
Description copied from interface:PsyFormalArrayRemoves the element at the specified position in this array.- Specified by:
deletein interfacePsyFormalArray<PsyObject>- Parameters:
indexValue- the index of the element to be removed.- Throws:
PsyRangeCheckException- if the index is out of range.
-
extract
- Specified by:
extractin interfacePsyFormalArray<PsyObject>- Throws:
PsyRangeCheckException
-
psyExtractInterval
public PsyArray psyExtractInterval(PsyInteger oStart, PsyInteger oCount) throws PsyRangeCheckException - Specified by:
psyExtractIntervalin interfacePsyFormalArray<PsyObject>- Throws:
PsyRangeCheckException
-
psySlice
public PsyArray psySlice(PsyIterable<PsyInteger> oIndices) throws PsyRangeCheckException, PsyLimitCheckException 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<PsyObject>- Specified by:
psySlicein 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:PsyClearableClear this object.- Specified by:
psyClearin interfacePsyClearable
-
psySetLength
- Specified by:
psySetLengthin interfacePsyFormalArray<PsyObject>- Throws:
PsyRangeCheckExceptionPsyLimitCheckException
-
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- theproccomparator 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:
psyStreamin interfacePsyIterable<PsyObject>- Specified by:
psyStreamin interfacePsyStreamable<PsyObject>
-