java.lang.Object
org.kink_lang.kink.internal.vec.VecInternal
org.kink_lang.kink.internal.vec.TraitVecInternal
- All Implemented Interfaces:
MaybeTrait
Immutable vec internal for elements
like ['A' a 'B' b 'C' c].
-
Method Summary
Modifier and TypeMethodDescriptiongetTrait()Returns the trait vec internal equal tothisif possible; otherwise null.Returns the trait vars.Inserts a val to the position index.insertAll(int index, VecInternal added) Inserts the elements ofaddedto the position index.insertRange(int index, Val[] src, int from, int to) Inserts the elements in the range ofsrcto the position index.remove(int index) Removes the indexed element from the vec internal.removeRange(int from, int to) Removes the range between the indices from the vec internal.Sets the indexed element.
-
Method Details
-
getTraitVars
Returns the trait vars.- Returns:
- the trait vars.
-
getTrait
Description copied from class:VecInternalReturns the trait vec internal equal tothisif possible; otherwise null.- Specified by:
getTraitin classVecInternal- Returns:
- the trait vec internal equal to
thisif possible, or null.
-
set
Description copied from class:VecInternalSets the indexed element.This is a linear update make.
- Specified by:
setin classVecInternal- Parameters:
index- the index.val- the element val.- Returns:
- this.
-
remove
Description copied from class:VecInternalRemoves the indexed element from the vec internal.This is a linear update make.
Precondition: 0 <= index < capa.
- Specified by:
removein classVecInternal- Parameters:
index- the index.- Returns:
- this.
-
removeRange
Description copied from class:VecInternalRemoves the range between the indices from the vec internal.This is a linear update make.
Precondition: 0 <= from <= to <= capa.
- Specified by:
removeRangein classVecInternal- Parameters:
from- the beginning index of the range (inclusive).to- the end index of the range (exclusive).- Returns:
- this.
-
insert
Description copied from class:VecInternalInserts a val to the position index.This is a linear update make.
Precondition: 0 <= index <= capa.
- Specified by:
insertin classVecInternal- Parameters:
index- the position index.val- the inserted val.- Returns:
- the result vec internal; it may be
this.
-
insertAll
Description copied from class:VecInternalInserts the elements ofaddedto the position index.This is a linear update make.
Precondition: 0 <= index <= capa.
- Specified by:
insertAllin classVecInternal- Parameters:
index- the position index.added- the added vec internal.- Returns:
- the result vec internal; it may be
this.
-
insertRange
Description copied from class:VecInternalInserts the elements in the range ofsrcto the position index.This is a linear update make.
Precondition: 0 <= index <= capa, 0 <= from <= to < src.length.
- Specified by:
insertRangein classVecInternal- Parameters:
index- the position index.src- array containing the added vals.from- the from index of the src.to- the to index of the src.- Returns:
- the result vec internal; it may be
this.
-