L<ShortList|SPVM::ShortList> is dynamic short array.
=head1 CLASS METHODS
=head2 new
static method new : ShortList ($array: short[])
Create a new L<ShortList|SPVM::ShortList> object withspecific C<short> array.
Internally, new array is created, and eachelement of argument array is copied to internal array.
If array is undef, 0-lengthinternal array is created.
=head2 new_len
static method new_len : ShortList ($length: int)
Create a new L<ShortList|SPVM::ShortList> object witharray length.
=head1 INSTANCE METHODS
=head2 get
method get : short ($index: int)
Get the value withindex.
=head2 insert
method insert : void ($index: int, $value: short)
Insert a element to the specific index.
=head2 length
static method length: int()
Get list length.
=head2 pop
method pop: short ()
Pops and returns the lastvalue of the list, shortening the array by one element
If there are noelements in the list, exception occur.
=head2 push
method push: void ($value: short)
Appending the value to the end of list.
=head2 remove
method remove : short ($index: int)
Remove and returnthe element which is specified by the index.
=head2 resize
method resize : void ($new_length: int)
Resize this list. If the new lengthis shorter than the current length, the list is truncated to the new length. If the new lengthis shorter than the current length, the list is truncated to the new length. If the new lengthis same as the current length, there is nothing to do. If the new lengthis longer than the current length, the list grows to the new length, and the valuesof the added elements are set to 0.
New lengthmust be more than or equals to 0, otherwise a exception occur.
=head2 set
method set : void ($index: int, $value: short)
Set the value withindex.
=head2 set_array
method set_array : void ($array: short[])
Set a array. Each elements of the array is copied to the correspoinding indexof the array this list has.
Array must be defined, otherwise a exception occurs.
The lengthof argument array must be same as the lengthof current list array, otherwise a exception occures.
=head2 shift
method shift: short ()
Shifts the first value of the list off and returns it, shortening
the array by 1 and moving everything down.
If there are noelements in the list, exception occur.
=head2 to_array
method to_array : short[] ()
Convert L<ShortList|SPVM::ShortList> to short array.
=head2 unshift
method unshift: void ($value: short)
Appending the value to the top of list.
Keyboard Shortcuts
Global
s
Focus search bar
?
Bring up this help dialog
GitHub
gp
Go to pull requests
gi
go to github issues (only if github is preferred repository)