Perhaps only a single generic parameter then, if each method should return the 
same type.
Or a sub-interface in which all three parameters are the same, the way that 
Java's `UnaryOperator` is related to `Function`.


________________________________________
From: ajs6f <aj...@apache.org>
Sent: Friday, November 17, 2017 10:01 AM
To: dev@jena.apache.org
Subject: Re: Generic RDFVisitor

Not sure how that would play against:

Object org.apache.jena.rdf.model.impl.ResourceImpl.visitWith(RDFVisitor)

OTOH, I'm not sure how much use the visitor pattern there has ever really 
gotten...

ajs6f

> On Nov 17, 2017, at 10:55 AM, Adam Jacobs <jacobs_...@hotmail.com> wrote:
>
> I wonder if it would be useful to generify the `RDFVisitor` interface...
>
> public interface RDFVisitor<B,U,L> {
>
>    B visitBlank( Resource r, AnonId id );
>    U visitURI( Resource r, String uri );
>    L visitLiteral( Literal l );
>
> }

Reply via email to