scala获得成员函数列表
scala> var rdd1=sc.parallelize(List((1,"a"),(4,"he"),(2,"b"),(3,"c")))
scala> rdd1.lookup(4).getClass.getMethods.map(_.getName).sorted
?
實驗結果:
res36: Array[String] = Array(hashCode, update, length, apply, apply, array, array, elemTag, last, clone, clone, isEmpty, startsWith, endsWith, toArray, iterator, make, find, zip, init, reverse, exists, empty, head, slice, copyToArray, tail, foreach, toSeq, canBuildFrom, newBuilder, companion, seq, seq, seq, seq, seq, seq, seq, seq, seq, thisCollection, thisCollection, thisCollection, thisCollection, thisCollection, thisCollection, toCollection, toCollection, toCollection, toCollection, toCollection, toCollection, parCombiner, isDefinedAt, reverseIterator, takeRight, dropRight, segmentLength, lengthCompare, indexWhere, lastIndexWhere, groupBy, forall, drop, take, takeWhile, dropWhile, span, splitAt, toTraversable, toBuffer, stringPrefix, view, view, view, view, ...
?
參考:
https://stackoverflow.com/questions/2886446/how-to-get-methods-list-in-scala
總結
以上是生活随笔為你收集整理的scala获得成员函数列表的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 星际战甲月光翡翠叶在哪 月光翡翠叶在哪个
- 下一篇: 大话西游手游无法登录怎么办