Gary Sieling

Listing object methods and class structure in scala

From scala, you can list all the methods on an object (essentially the same as pressing tab in the repl), by doing this:

List(1,2,3)
  .getClass.getMethods()

You can get the full method / class list by doing the following:

List(1,2,3)
  .map( 
    (method) => { List(method.getDeclaringClass, method.getName) }
  ).map(println)

Which will give you the following result, neatly sorted by the class hierarchy:

List(class scala.collection.immutable.$colon$colon, head)
List(class scala.collection.immutable.$colon$colon, tail)
List(class scala.collection.immutable.$colon$colon, tail)
List(class scala.collection.immutable.$colon$colon, tail)
List(class scala.collection.immutable.$colon$colon, productIterator)
List(class scala.collection.immutable.$colon$colon, productPrefix)
List(class scala.collection.immutable.$colon$colon, productElement)
List(class scala.collection.immutable.$colon$colon, productArity)
List(class scala.collection.immutable.$colon$colon, tl)
List(class scala.collection.immutable.$colon$colon, isEmpty)
List(class scala.collection.immutable.$colon$colon, copy$default$1)
List(class scala.collection.immutable.$colon$colon, copy$default$2)
List(class scala.collection.immutable.$colon$colon, copy)
List(class scala.collection.immutable.$colon$colon, tl_$eq)
List(class scala.collection.immutable.$colon$colon, tl$1)
List(class scala.collection.immutable.List, exists)
List(class scala.collection.immutable.List, writeReplace)
List(class scala.collection.immutable.List, empty)
List(class scala.collection.immutable.List, empty)
List(class scala.collection.immutable.List, slice)
List(class scala.collection.immutable.List, slice)
List(class scala.collection.immutable.List, slice)
List(class scala.collection.immutable.List, map)
List(class scala.collection.immutable.List, toList)
List(class scala.collection.immutable.List, canBuildFrom)
List(class scala.collection.immutable.List, apply)
List(class scala.collection.immutable.List, apply)
List(class scala.collection.immutable.List, $plus$plus)
List(class scala.collection.immutable.List, $plus$colon)
List(class scala.collection.immutable.List, flatMap)
List(class scala.collection.immutable.List, forall)
List(class scala.collection.immutable.List, foreach)
List(class scala.collection.immutable.List, collect)
List(class scala.collection.immutable.List, hashCode)
List(class scala.collection.immutable.List, length)
List(class scala.collection.immutable.List, concat)
List(class scala.collection.immutable.List, contains)
List(class scala.collection.immutable.List, iterator)
List(class scala.collection.immutable.List, find)
List(class scala.collection.immutable.List, fill)
List(class scala.collection.immutable.List, fill)
List(class scala.collection.immutable.List, fill)
List(class scala.collection.immutable.List, fill)
List(class scala.collection.immutable.List, fill)
List(class scala.collection.immutable.List, reverse)
List(class scala.collection.immutable.List, reverse)
List(class scala.collection.immutable.List, drop)
List(class scala.collection.immutable.List, drop)
List(class scala.collection.immutable.List, drop)
List(class scala.collection.immutable.List, $colon$colon)
List(class scala.collection.immutable.List, takeWhile)
List(class scala.collection.immutable.List, takeWhile)
List(class scala.collection.immutable.List, takeWhile)
List(class scala.collection.immutable.List, seq)
List(class scala.collection.immutable.List, seq)
List(class scala.collection.immutable.List, seq)
List(class scala.collection.immutable.List, seq)
List(class scala.collection.immutable.List, seq)
List(class scala.collection.immutable.List, seq)
List(class scala.collection.immutable.List, seq)
List(class scala.collection.immutable.List, seq)
List(class scala.collection.immutable.List, seq)
List(class scala.collection.immutable.List, ReusableCBF)
List(class scala.collection.immutable.List, tabulate)
List(class scala.collection.immutable.List, tabulate)
List(class scala.collection.immutable.List, tabulate)
List(class scala.collection.immutable.List, tabulate)
List(class scala.collection.immutable.List, tabulate)
List(class scala.collection.immutable.List, range)
List(class scala.collection.immutable.List, range)
List(class scala.collection.immutable.List, iterate)
List(class scala.collection.immutable.List, scala$collection$LinearSeqOptimized$$super$sameElements)
List(class scala.collection.immutable.List, unapplySeq)
List(class scala.collection.immutable.List, sameElements)
List(class scala.collection.immutable.List, foldLeft)
List(class scala.collection.immutable.List, reduceLeft)
List(class scala.collection.immutable.List, reduceRight)
List(class scala.collection.immutable.List, last)
List(class scala.collection.immutable.List, dropRight)
List(class scala.collection.immutable.List, dropRight)
List(class scala.collection.immutable.List, lengthCompare)
List(class scala.collection.immutable.List, isDefinedAt)
List(class scala.collection.immutable.List, isDefinedAt)
List(class scala.collection.immutable.List, segmentLength)
List(class scala.collection.immutable.List, indexWhere)
List(class scala.collection.immutable.List, lastIndexWhere)
List(class scala.collection.immutable.List, thisCollection)
List(class scala.collection.immutable.List, thisCollection)
List(class scala.collection.immutable.List, thisCollection)
List(class scala.collection.immutable.List, thisCollection)
List(class scala.collection.immutable.List, toCollection)
List(class scala.collection.immutable.List, toCollection)
List(class scala.collection.immutable.List, toCollection)
List(class scala.collection.immutable.List, toCollection)
List(class scala.collection.immutable.List, corresponds)
List(class scala.collection.immutable.List, toSeq)
List(class scala.collection.immutable.List, toSeq)
List(class scala.collection.immutable.List, toSeq)
List(class scala.collection.immutable.List, parCombiner)
List(class scala.collection.immutable.List, companion)
List(class scala.collection.immutable.List, $colon$colon$colon)
List(class scala.collection.immutable.List, reverse_$colon$colon$colon)
List(class scala.collection.immutable.List, mapConserve)
List(class scala.collection.immutable.List, take)
List(class scala.collection.immutable.List, take)
List(class scala.collection.immutable.List, take)
List(class scala.collection.immutable.List, takeRight)
List(class scala.collection.immutable.List, takeRight)
List(class scala.collection.immutable.List, splitAt)
List(class scala.collection.immutable.List, dropWhile)
List(class scala.collection.immutable.List, dropWhile)
List(class scala.collection.immutable.List, span)
List(class scala.collection.immutable.List, foldRight)
List(class scala.collection.immutable.List, stringPrefix)
List(class scala.collection.immutable.List, toStream)
List(class scala.collection.immutable.List, toTraversable)
List(class scala.collection.immutable.List, groupBy)
List(class scala.collection.immutable.List, toIterable)
List(class scala.collection.immutable.List, view)
List(class scala.collection.immutable.List, view)
List(class scala.collection.immutable.List, view)
List(class scala.collection.immutable.List, view)
List(class scala.collection.AbstractSeq, prefixLength)
List(class scala.collection.AbstractSeq, lift)
List(class scala.collection.AbstractSeq, orElse)
List(class scala.collection.AbstractSeq, equals)
List(class scala.collection.AbstractSeq, toString)
List(class scala.collection.AbstractSeq, indexOf)
List(class scala.collection.AbstractSeq, indexOf)
List(class scala.collection.AbstractSeq, startsWith)
List(class scala.collection.AbstractSeq, startsWith)
List(class scala.collection.AbstractSeq, endsWith)
List(class scala.collection.AbstractSeq, lastIndexOf)
List(class scala.collection.AbstractSeq, lastIndexOf)
List(class scala.collection.AbstractSeq, size)
List(class scala.collection.AbstractSeq, diff)
List(class scala.collection.AbstractSeq, runWith)
List(class scala.collection.AbstractSeq, permutations)
List(class scala.collection.AbstractSeq, combinations)
List(class scala.collection.AbstractSeq, reverseMap)
List(class scala.collection.AbstractSeq, patch)
List(class scala.collection.AbstractSeq, updated)
List(class scala.collection.AbstractSeq, padTo)
List(class scala.collection.AbstractSeq, union)
List(class scala.collection.AbstractSeq, intersect)
List(class scala.collection.AbstractSeq, distinct)
List(class scala.collection.AbstractSeq, reverseIterator)
List(class scala.collection.AbstractSeq, indexOfSlice)
List(class scala.collection.AbstractSeq, indexOfSlice)
List(class scala.collection.AbstractSeq, lastIndexOfSlice)
List(class scala.collection.AbstractSeq, lastIndexOfSlice)
List(class scala.collection.AbstractSeq, containsSlice)
List(class scala.collection.AbstractSeq, sortWith)
List(class scala.collection.AbstractSeq, sorted)
List(class scala.collection.AbstractSeq, indices)
List(class scala.collection.AbstractSeq, sortBy)
List(class scala.collection.AbstractSeq, $colon$plus)
List(class scala.collection.AbstractSeq, apply$mcZD$sp)
List(class scala.collection.AbstractSeq, apply$mcDD$sp)
List(class scala.collection.AbstractSeq, apply$mcFD$sp)
List(class scala.collection.AbstractSeq, apply$mcID$sp)
List(class scala.collection.AbstractSeq, apply$mcJD$sp)
List(class scala.collection.AbstractSeq, apply$mcVD$sp)
List(class scala.collection.AbstractSeq, apply$mcZF$sp)
List(class scala.collection.AbstractSeq, apply$mcDF$sp)
List(class scala.collection.AbstractSeq, apply$mcFF$sp)
List(class scala.collection.AbstractSeq, apply$mcIF$sp)
List(class scala.collection.AbstractSeq, apply$mcJF$sp)
List(class scala.collection.AbstractSeq, apply$mcVF$sp)
List(class scala.collection.AbstractSeq, apply$mcZI$sp)
List(class scala.collection.AbstractSeq, apply$mcDI$sp)
List(class scala.collection.AbstractSeq, apply$mcFI$sp)
List(class scala.collection.AbstractSeq, apply$mcII$sp)
List(class scala.collection.AbstractSeq, apply$mcJI$sp)
List(class scala.collection.AbstractSeq, apply$mcVI$sp)
List(class scala.collection.AbstractSeq, apply$mcZJ$sp)
List(class scala.collection.AbstractSeq, apply$mcDJ$sp)
List(class scala.collection.AbstractSeq, apply$mcFJ$sp)
List(class scala.collection.AbstractSeq, apply$mcIJ$sp)
List(class scala.collection.AbstractSeq, apply$mcJJ$sp)
List(class scala.collection.AbstractSeq, apply$mcVJ$sp)
List(class scala.collection.AbstractSeq, compose)
List(class scala.collection.AbstractSeq, andThen)
List(class scala.collection.AbstractSeq, andThen)
List(class scala.collection.AbstractSeq, indexWhere)
List(class scala.collection.AbstractSeq, lastIndexWhere)
List(class scala.collection.AbstractSeq, applyOrElse)
List(class scala.collection.AbstractSeq, view)
List(class scala.collection.AbstractSeq, view)
List(class scala.collection.AbstractIterable, copyToArray)
List(class scala.collection.AbstractIterable, canEqual)
List(class scala.collection.AbstractIterable, zip)
List(class scala.collection.AbstractIterable, toIterable)
List(class scala.collection.AbstractIterable, toIterator)
List(class scala.collection.AbstractIterable, grouped)
List(class scala.collection.AbstractIterable, sliding)
List(class scala.collection.AbstractIterable, sliding)
List(class scala.collection.AbstractIterable, zipWithIndex)
List(class scala.collection.AbstractIterable, zipAll)
List(class scala.collection.AbstractTraversable, nonEmpty)
List(class scala.collection.AbstractTraversable, copyToArray)
List(class scala.collection.AbstractTraversable, copyToArray)
List(class scala.collection.AbstractTraversable, mkString)
List(class scala.collection.AbstractTraversable, mkString)
List(class scala.collection.AbstractTraversable, mkString)
List(class scala.collection.AbstractTraversable, fold)
List(class scala.collection.AbstractTraversable, flatten)
List(class scala.collection.AbstractTraversable, filterNot)
List(class scala.collection.AbstractTraversable, withFilter)
List(class scala.collection.AbstractTraversable, count)
List(class scala.collection.AbstractTraversable, min)
List(class scala.collection.AbstractTraversable, max)
List(class scala.collection.AbstractTraversable, toArray)
List(class scala.collection.AbstractTraversable, init)
List(class scala.collection.AbstractTraversable, filter)
List(class scala.collection.AbstractTraversable, headOption)
List(class scala.collection.AbstractTraversable, toSet)
List(class scala.collection.AbstractTraversable, toSet)
List(class scala.collection.AbstractTraversable, newBuilder)
List(class scala.collection.AbstractTraversable, sum)
List(class scala.collection.AbstractTraversable, genericBuilder)
List(class scala.collection.AbstractTraversable, repr)
List(class scala.collection.AbstractTraversable, toTraversable)
List(class scala.collection.AbstractTraversable, groupBy)
List(class scala.collection.AbstractTraversable, isTraversableAgain)
List(class scala.collection.AbstractTraversable, hasDefiniteSize)
List(class scala.collection.AbstractTraversable, $plus$plus$colon)
List(class scala.collection.AbstractTraversable, $plus$plus$colon)
List(class scala.collection.AbstractTraversable, partition)
List(class scala.collection.AbstractTraversable, scan)
List(class scala.collection.AbstractTraversable, scanLeft)
List(class scala.collection.AbstractTraversable, scanRight)
List(class scala.collection.AbstractTraversable, lastOption)
List(class scala.collection.AbstractTraversable, sliceWithKnownDelta)
List(class scala.collection.AbstractTraversable, sliceWithKnownBound)
List(class scala.collection.AbstractTraversable, tails)
List(class scala.collection.AbstractTraversable, inits)
List(class scala.collection.AbstractTraversable, to)
List(class scala.collection.AbstractTraversable, reversed)
List(class scala.collection.AbstractTraversable, collectFirst)
List(class scala.collection.AbstractTraversable, $div$colon)
List(class scala.collection.AbstractTraversable, $colon$bslash)
List(class scala.collection.AbstractTraversable, reduceLeftOption)
List(class scala.collection.AbstractTraversable, reduceRightOption)
List(class scala.collection.AbstractTraversable, reduce)
List(class scala.collection.AbstractTraversable, reduceOption)
List(class scala.collection.AbstractTraversable, aggregate)
List(class scala.collection.AbstractTraversable, product)
List(class scala.collection.AbstractTraversable, maxBy)
List(class scala.collection.AbstractTraversable, minBy)
List(class scala.collection.AbstractTraversable, copyToBuffer)
List(class scala.collection.AbstractTraversable, toIndexedSeq)
List(class scala.collection.AbstractTraversable, toBuffer)
List(class scala.collection.AbstractTraversable, toVector)
List(class scala.collection.AbstractTraversable, toMap)
List(class scala.collection.AbstractTraversable, toMap)
List(class scala.collection.AbstractTraversable, addString)
List(class scala.collection.AbstractTraversable, addString)
List(class scala.collection.AbstractTraversable, addString)
List(class scala.collection.AbstractTraversable, par)
List(class scala.collection.AbstractTraversable, unzip)
List(class scala.collection.AbstractTraversable, unzip3)
List(class scala.collection.AbstractTraversable, transpose)
List(class java.lang.Object, wait)
List(class java.lang.Object, wait)
List(class java.lang.Object, wait)
List(class java.lang.Object, getClass)
List(class java.lang.Object, notify)
List(class java.lang.Object, notifyAll)
Exit mobile version