Skip to content

Commit

Permalink
new methods added to ReflectionData
Browse files Browse the repository at this point in the history
  • Loading branch information
kushti committed Sep 24, 2024
1 parent 9fd499a commit 8136c8f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions core/shared/src/main/scala/sigma/reflection/ReflectionData.scala
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ object ReflectionData {
mkMethod(clazz, "apply", Array[Class[_]](classOf[Int])) { (obj, args) =>
obj.asInstanceOf[Coll[_]].apply(args(0).asInstanceOf[Int])
},
mkMethod(clazz, "get", Array[Class[_]](classOf[Int])) { (obj, args) =>
obj.asInstanceOf[Coll[_]].apply(args(0).asInstanceOf[Int])
},
mkMethod(clazz, "append", Array[Class[_]](classOf[Coll[_]])) { (obj, args) =>
obj.asInstanceOf[Coll[Any]].append(args(0).asInstanceOf[Coll[Any]])
},
Expand All @@ -170,6 +173,18 @@ object ReflectionData {
},
mkMethod(clazz, "map", Array[Class[_]](classOf[Function1[_, _]], classOf[RType[_]])) { (obj, args) =>
obj.asInstanceOf[Coll[Any]].map(args(0).asInstanceOf[Any => Any])(args(1).asInstanceOf[RType[Any]])
},
mkMethod(clazz, "reverse", Array[Class[_]]()) { (obj, args) =>
obj.asInstanceOf[Coll[Any]].reverse
},
mkMethod(clazz, "distinct", Array[Class[_]]()) { (obj, args) =>
obj.asInstanceOf[Coll[Any]].distinct
},
mkMethod(clazz, "startsWith", Array[Class[_]](classOf[Coll[_]])) { (obj, args) =>
obj.asInstanceOf[Coll[Any]].startsWith(args(0).asInstanceOf[Coll[Any]])
},
mkMethod(clazz, "endsWith", Array[Class[_]](classOf[Coll[_]])) { (obj, args) =>
obj.asInstanceOf[Coll[Any]].endsWith(args(0).asInstanceOf[Coll[Any]])
}
)
)
Expand Down

0 comments on commit 8136c8f

Please sign in to comment.