Skip to content

Commit

Permalink
Merge branch 'master' of github.com:nddrylliog/rock
Browse files Browse the repository at this point in the history
  • Loading branch information
nddrylliog committed Jun 23, 2010
2 parents dd450aa + a0e3fec commit f792c17
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions sdk/structs/HashBag.ooc
@@ -1,4 +1,4 @@
import structs/HashMap
import structs/[ArrayList, HashMap]

HashBag: class {

Expand All @@ -13,7 +13,11 @@ HashBag: class {
}

get: func <T> (key: String, T: Class) -> T {
return getEntry(key, T) value as T
return getEntry(key, T) value as T // TODO: segfault if `key` is not in this
}

getClass: func (key: String) -> Class {
return myMap get(key) as Cell T
}

getEntry: func <V> (key: String, V: Class) -> HashEntry<String, Pointer> {
Expand Down Expand Up @@ -47,5 +51,9 @@ HashBag: class {
contains: func(key: String) -> Bool {
myMap get(key) ? true : false
}

getKeys: func -> ArrayList<String> {
myMap getKeys()
}
}

0 comments on commit f792c17

Please sign in to comment.