|
NAMEData::Object::ArrayABSTRACTArray Class for Perl 5SYNOPSISpackage main; use Data::Object::Array; my $array = Data::Object::Array->new([1..9]); DESCRIPTIONThis package provides methods for manipulating array data.INHERITSThis package inherits behaviors from:Data::Object::Kind INTEGRATESThis package integrates behaviors from:Data::Object::Role::Dumpable Data::Object::Role::Pluggable Data::Object::Role::Throwable LIBRARIESThis package uses type constraints from:Data::Object::Types METHODSThis package implements the following methods:allall(CodeRef $arg1, Any @args) : Num The all method returns true if the callback returns true for all of the elements.
anyany(CodeRef $arg1, Any @args) : Num The any method returns true if the callback returns true for any of the elements.
clearclear() : ArrayLike The clear method is an alias to the empty method.
countcount() : Num The count method returns the number of elements within the array.
defineddefined() : Num The defined method returns true if the element at the array index is defined.
deletedelete(Int $arg1) : Any The delete method returns the value of the element at the index specified after removing it from the array.
eacheach(CodeRef $arg1, Any @args) : ArrayLike The each method executes a callback for each element in the array passing the index and value as arguments.
each_keyeach_key(CodeRef $arg1, Any @args) : ArrayRef The each_key method executes a callback for each element in the array passing the index as an argument.
each_n_valueseach_n_values(Num $arg1, CodeRef $arg2, Any @args) : ArrayRef The each_n_values method executes a callback for each element in the array passing the routine the next n values until all values have been handled.
each_valueeach_value(CodeRef $arg1, Any @args) : ArrayRef The each_value method executes a callback for each element in the array passing the routine the value as an argument.
emptyempty() : ArrayLike The empty method drops all elements from the array.
eqeq(Any $arg1) : Num The eq method will throw an exception if called.
existsexists(Int $arg1) : Num The exists method returns true if the element at the index specified exists, otherwise it returns false.
firstfirst() : Any The first method returns the value of the first element.
gege(Any $arg1) : Num The ge method will throw an exception if called.
getget(Int $arg1) : Any The get method returns the value of the element at the index specified.
grepgrep(CodeRef $arg1, Any @args) : ArrayRef The grep method executes a callback for each element in the array passing the value as an argument, returning a new array reference containing the elements for which the returned true.
gtgt(Any $arg1) : Num The gt method will throw an exception if called.
hashhash() : HashRef The hash method returns a hash reference where each key and value pairs corresponds to the index and value of each element in the array.
hashifyhashify(CodeRef $arg1, Any $arg2) : HashRef The hashify method returns a hash reference where the elements of array become the hash keys and the corresponding values are assigned a value of 1.
headhead() : Any The head method returns the value of the first element in the array.
invertinvert() : Any The invert method returns an array reference containing the elements in the array in reverse order.
iteratoriterator() : CodeRef The iterator method returns a code reference which can be used to iterate over the array. Each time the iterator is executed it will return the next element in the array until all elements have been seen, at which point the iterator will return an undefined value.
joinjoin(Str $arg1) : Str The join method returns a string consisting of all the elements in the array joined by the join-string specified by the argument. Note: If the argument is omitted, an empty string will be used as the join-string.
keyedkeyed(Str $arg1) : HashRef The keyed method returns a hash reference where the arguments become the keys, and the elements of the array become the values.
keyskeys() : ArrayRef The keys method returns an array reference consisting of the indicies of the array.
lastlast() : Any The last method returns the value of the last element in the array.
lele(Any $arg1) : Num The le method will throw an exception if called.
lengthlength() : Num The length method returns the number of elements in the array.
listlist() : (Any) The list method returns a shallow copy of the underlying array reference as an array reference.
ltlt(Any $arg1) : Num The lt method will throw an exception if called.
mapmap(CodeRef $arg1, Any $arg2) : ArrayRef The map method iterates over each element in the array, executing the code reference supplied in the argument, passing the routine the value at the current position in the loop and returning a new array reference containing the elements for which the argument returns a value or non-empty list.
maxmax() : Any The max method returns the element in the array with the highest numerical value. All non-numerical element are skipped during the evaluation process.
minmin() : Any The min method returns the element in the array with the lowest numerical value. All non-numerical element are skipped during the evaluation process.
nene(Any $arg1) : Num The ne method will throw an exception if called.
nonenone(CodeRef $arg1, Any $arg2) : Num The none method returns true if none of the elements in the array meet the criteria set by the operand and rvalue.
nsortnsort() : ArrayRef The nsort method returns an array reference containing the values in the array sorted numerically.
oneone(CodeRef $arg1, Any $arg2) : Num The one method returns true if only one of the elements in the array meet the criteria set by the operand and rvalue.
pairspairs() : ArrayRef The pairs method is an alias to the pairs_array method.
pairs_arraypairs_array() : ArrayRef The pairs_array method returns an array reference consisting of array references where each sub-array reference has two elements corresponding to the index and value of each element in the array.
pairs_hashpairs_hash() : HashRef The pairs_hash method returns a hash reference where each key and value pairs corresponds to the index and value of each element in the array.
partpart(CodeRef $arg1, Any $arg2) : Tuple[ArrayRef, ArrayRef] The part method iterates over each element in the array, executing the code reference supplied in the argument, using the result of the code reference to partition to array into two distinct array references.
poppop() : Any The pop method returns the last element of the array shortening it by one. Note, this method modifies the array.
pushpush(Any $arg1) : Any The push method appends the array by pushing the agruments onto it and returns itself.
randomrandom() : Any The random method returns a random element from the array.
reversereverse() : ArrayRef The reverse method returns an array reference containing the elements in the array in reverse order.
rnsortrnsort() : ArrayRef The rnsort method returns an array reference containing the values in the array sorted numerically in reverse.
rotaterotate() : ArrayLike The rotate method rotates the elements in the array such that first elements becomes the last element and the second element becomes the first element each time this method is called.
rsortrsort() : ArrayRef The rsort method returns an array reference containing the values in the array sorted alphanumerically in reverse.
setset(Str $arg1, Any $arg2) : Any The set method returns the value of the element in the array at the index specified by the argument after updating it to the value of the second argument.
shiftshift() : Any The shift method returns the first element of the array shortening it by one.
sizesize() : Num The size method is an alias to the length method.
sliceslice(Any @args) : HashRef The slice method returns a hash reference containing the elements in the array at the index(es) specified in the arguments.
sortsort() : ArrayRef The sort method returns an array reference containing the values in the array sorted alphanumerically.
sumsum() : Num The sum method returns the sum of all values for all numerical elements in the array. All non-numerical element are skipped during the evaluation process.
tailtail() : Any The tail method returns an array reference containing the second through the last elements in the array omitting the first.
uniqueunique() : ArrayRef The unique method returns an array reference consisting of the unique elements in the array.
unshiftunshift() : Any The unshift method prepends the array by pushing the agruments onto it and returns itself.
valuesvalues() : ArrayRef The values method returns an array reference consisting of the elements in the array. This method essentially copies the content of the array into a new container.
AUTHORAl Newkirk, "awncorp@cpan.org"LICENSECopyright (C) 2011-2019, Al Newkirk, et al.This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated in the "license file" <https://github.com/iamalnewkirk/data-object/blob/master/LICENSE>. PROJECTWiki <https://github.com/iamalnewkirk/data-object/wiki>Project <https://github.com/iamalnewkirk/data-object> Initiatives <https://github.com/iamalnewkirk/data-object/projects> Milestones <https://github.com/iamalnewkirk/data-object/milestones> Contributing <https://github.com/iamalnewkirk/data-object/blob/master/CONTRIBUTE.md> Issues <https://github.com/iamalnewkirk/data-object/issues>
Visit the GSP FreeBSD Man Page Interface. |