Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def isFilterTextExist(filterText : String,data : SItem) : Boolean = {
- def loop(data : Seq[SItem]) : Boolean = {
- data.view.exists(item => if(item.children.isEmpty) item.name.contains(filterText) else loop(item.children))
- }
- data.item.toString.contains(filterText) || loop(data.children)
- }
- case class SItem(name: String, children: SItem*)
- is this impl is good ? any better solutions than this ..
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement