![]() |
![]()
| ![]() |
![]()
NAMEData::Object::HashABSTRACTHash Class for Perl 5SYNOPSISpackage main; use Data::Object::Hash; my $hash = Data::Object::Hash->new({1..4}); DESCRIPTIONThis package provides methods for manipulating hash data.INHERITSThis package inherits behaviors from:Data::Object::Kind INTEGRATESThis package integrates behaviors from:Data::Object::Role::Dumpable Data::Object::Role::Proxyable Data::Object::Role::Throwable LIBRARIESThis package uses type constraints from:Data::Object::Types METHODSThis package implements the following methods:clearclear() : HashLike The clear method is an alias to the empty method.
countcount() : Num The count method returns the total number of keys defined.
defineddefined() : Num The defined method returns true if the value matching the key specified in the argument if defined, otherwise returns false.
deletedelete(Num $arg1) : Any The delete method returns the value matching the key specified in the argument and returns the value.
eacheach(CodeRef $arg1, Any @args) : Any The each method executes callback for each element in the hash passing the routine the key and value at the current position in the loop.
each_keyeach_key(CodeRef $arg1, Any @args) : Any The each_key method executes callback for each element in the hash passing the routine the key at the current position in the loop.
each_n_valueseach_n_values(Num $arg1, CodeRef $arg2, Any @args) : Any The each_n_values method executes callback for each element in the hash passing the routine the next n values until all values have been seen.
each_valueeach_value(CodeRef $arg1, Any @args) : Any The each_value method executes callback for each element in the hash passing the routine the value at the current position in the loop.
emptyempty() : HashLike The empty method drops all elements from the hash.
eqeq(Any $arg1) : Num The eq method will throw an exception if called.
existsexists(Num $arg1) : Num The exists method returns true if the value matching the key specified in the argument exists, otherwise returns false.
filter_excludefilter_exclude(Str @args) : HashRef The filter_exclude method returns a hash reference consisting of all key/value pairs in the hash except for the pairs whose keys are specified in the arguments.
filter_includefilter_include(Str @args) : HashRef The filter_include method returns a hash reference consisting of only key/value pairs whose keys are specified in the arguments.
foldfold(Str $arg1, HashRef $arg2, HashRef $arg3) : HashRef The fold method returns a single-level hash reference consisting of key/value pairs whose keys are paths (using dot-notation where the segments correspond to nested hash keys and array indices) mapped to the nested values.
gege(Any $arg1) : Num The ge method will throw an exception if called.
getget(Str $arg1) : Any The get method returns the value of the element in the hash whose key corresponds to the key specified in the argument.
grepgrep(CodeRef $arg1, Any $arg2) : HashRef The grep method executes callback for each key/value pair in the hash passing the routine the key and value at the current position in the loop and returning a new hash reference containing the elements for which the argument evaluated true.
gtgt(Any $arg1) : Num The gt method will throw an exception if called.
headhead() : Any The head method will throw an exception if called.
invertinvert() : Any The invert method returns the hash after inverting the keys and values respectively. Note, keys with undefined values will be dropped, also, this method modifies the hash.
iteratoriterator() : CodeRef The iterator method returns a code reference which can be used to iterate over the hash. Each time the iterator is executed it will return the values of the next element in the hash until all elements have been seen, at which point the iterator will return an undefined value.
joinjoin() : Any The join method will throw an exception if called.
keyskeys() : ArrayRef The keys method returns an array reference consisting of all the keys in the hash.
kvslicekvslice(Str @args) : HashRef The kvslice method returns a hash reference containing the elements in the hash at the key(s) specified in the arguments.
lele(Any $arg1) : Num The le method will throw an exception if called.
lengthlength() : Num The length method returns the number of keys in the hash.
listlist() : (Any) The list method returns a shallow copy of the underlying hash reference as an array reference.
lookuplookup(Str $arg1) : Any The lookup method returns the value of the element in the hash whose key corresponds to the key specified in the argument. The key can be a string which references (using dot-notation) nested keys within the hash. This method will return undefined if the value is undef or the location expressed in the argument can not be resolved. Please note, keys containing dots (periods) are not handled.
ltlt(Any $arg1) : Num The lt method will throw an exception if called.
mapmap(CodeRef $arg1, Any $arg2) : ArrayRef The map method executes callback for each key/value in the hash passing the routine the value at the current position in the loop and returning a new hash reference containing the elements for which the argument returns a value or non-empty list.
mergemerge() : HashRef The merge method returns a hash reference where the elements in the hash and the elements in the argument(s) are merged. This operation performs a deep merge and clones the datasets to ensure no side-effects. The merge behavior merges hash references only, all other data types are assigned with precendence given to the value being merged.
nene(Any $arg1) : Num The ne method will throw an exception if called.
pairspairs() : ArrayRef The pairs method is an alias to the pairs_array method.
resetreset() : HashLike The reset method returns nullifies the value of each element in the hash.
reversereverse() : HashRef The reverse method returns a hash reference consisting of the hash's keys and values inverted. Note, keys with undefined values will be dropped.
setset(Str $arg1, Any $arg2) : Any The set method returns the value of the element in the hash corresponding to the key specified by the argument after updating it to the value of the second argument.
sliceslice(Str @args) : ArrayRef The slice method returns an array reference of the values that correspond to the key(s) specified in the arguments.
sortsort() : Any The sort method will throw an exception if called.
tailtail() : Any The tail method will throw an exception if called.
unfoldunfold() : HashRef The unfold method processes previously folded hash references and returns an unfolded hash reference where the keys, which are paths (using dot-notation where the segments correspond to nested hash keys and array indices), are used to created nested hash and/or array references.
valuesvalues() : ArrayRef The values method returns an array reference consisting of the values of the elements in the hash.
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>
|