R/generics.R
R/hashmap.R
R/hashset.R
has_key.Rd
This generics are used to check whether a key exists in a given hashset or hashmap.
hashset
hashmap
has_key(x, key) x %has_key% key # S3 method for class 'r2r_hashmap' has_key(x, key) # S3 method for class 'r2r_hashset' has_key(x, key)
an hashset or hashmap.
an arbitrary R object. Key to be checked for existence in the hash table.
TRUE or FALSE.
TRUE
FALSE
Valerio Gherardi
m <- hashmap(list("a", 1), list("b", 2)) has_key(m, "a") #> [1] TRUE m %has_key% "b" #> [1] TRUE