Support for searching for subelements in element using lambda (#6)
Closed
Andrzej Wójcik (Tigase) opened 9 years ago
Due Date
2015-04-29

As of JDK8 there is support for lambda expressions (simialar to implementation of anonymous classes with single method) which could be used to filter children element of element (alternative to getChildrenStaticStr method).

If we do this, we would be able to pass more advanced queries and ie. remove some results from result list which is not possible now.

This could result in faster lookup of some subelements.

We may also think about rewritting current methods of Element class to use lambda expressions as according to http://www.oracle.com/technetwork/java/jvmls2013kuksen-2014088.pdf lamba expressions might be faster, ie. do to filtering done in other way (filtering of subelements of subelements could be done without additional instance of LinkedList we need now)

Andrzej Wójcik (Tigase) commented 9 years ago

I marked this task as related to #2865 as to rewrite methods with use of lambdas we would need to use JDK8, however to prepare interface to filter using lambdas we would not need to use JDK8.

Artur Hefczyc commented 9 years ago

Ok, but the performance and low resources consumption is the priority for this class.

Andrzej Wójcik (Tigase) commented 9 years ago

I tried to use newly introduced in JDK8 Stream API to process Elements but it added a lot of overhead, so I only added additional methods to so that it would be possible to use lambda expressions to search and process elements and children, which allows to create easier more complex searches or even to create transformations.

issue 1 of 1
Type
Task
Priority
Normal
Assignee
RedmineID
2866
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/tigase-xmltools#6
Please wait...
Page is in error, reload to recover