Created
July 23, 2010 00:57
-
-
Save harrah/486864 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.collection.JavaConversions._ | |
object A | |
{ | |
def main(args: Array[String]) = | |
{ | |
import X._ | |
val list: java.util.List[GR] = new java.util.ArrayList[GR] | |
list.add(new GR) | |
println( list.map(_._1) ) | |
} | |
} | |
object X | |
{ | |
import MSB.restrictionToTuple | |
implicit def conv(grs: java.util.List[GR]): Seq[(EntityType, Expression[_])] = | |
(grs: Seq[GR]).map(gr => (EntityType.valueOf(gr.getEntityType), gr.getExpression)).toSeq | |
//grs.map(gr => (EntityType.valueOf(gr.getEntityType), gr.getExpression)).toSeq | |
//grs.toSeq | |
} | |
object MSB | |
{ | |
implicit def restrictionToTuple(gr: GR) = (EntityType.valueOf(gr.getEntityType), gr.getExpression) | |
} | |
class Expression[T] | |
class GR | |
{ | |
def getExpression: Expression[_] = null | |
def getEntityType = 3 | |
} | |
object EntityType | |
{ | |
def valueOf(i: Int) = new EntityType | |
} | |
class EntityType |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment