Skip to content

Instantly share code, notes, and snippets.

@ivyl
Created March 22, 2011 12:46
Show Gist options
  • Save ivyl/881155 to your computer and use it in GitHub Desktop.
Save ivyl/881155 to your computer and use it in GitHub Desktop.
useful things for using db4o in scala, need to be reviewed
implicit def toPredicate[T](predicate: T => Boolean) =
new Predicate[T]() {def `match`(entry: T): Boolean = {predicate(entry)}}
class RichObjectSet[T](objectSet:ObjectSet[T]) extends Iterator[T] {
def hasNext:Boolean = objectSet.hasNext()
def next:T = objectSet.next()
}
implicit def toRichObjectSet[T](objectSet: ObjectSet[T] ) =
new RichObjectSet[T](objectSet)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment