Added Ptr<T> support to Java wrappers

Added support for algorithm factory methods to Java API generator