0.0.3 • Published 12 years ago

coffee-collection v0.0.3

Weekly downloads
11
License
-
Repository
github
Last release
12 years ago

Coffee-Collection

A fine collection of collection-classes and utilities written in CoffeScript. Intended for Node- and client-side usage.

Currently contains

  • Set - each entry is singular, no duplicates allowed
  • Map - stores "entries" for provided "keys" like a dictionary
  • Graph - a set of nodes where each node max be conected with other nodes making a path

Examples

Set

fruit = new Set
fruit.add 'Apple'
fruit.add 'Banana'
fruit.add 'Cherry'
fruit.size() # => 3

fruit.add 'Apple' # adding the same entry twice
fruit.size() # => 3

fruit.has 'Cherry' # => true
fruit.has 'Raspberry' # => false

fruit.elements() # => ['Apple', 'Banana', 'Cherry']