[
https://issues.apache.org/jira/browse/EDGENT-229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dale LaBossiere updated EDGENT-229:
-----------------------------------
Component/s: API
> Streams and tuple type hierarchies - TStream.cast()?
> ----------------------------------------------------
>
> Key: EDGENT-229
> URL: https://issues.apache.org/jira/browse/EDGENT-229
> Project: Edgent
> Issue Type: Improvement
> Components: API
> Reporter: Dale LaBossiere
> Priority: Minor
>
> In a real use case there were two different types of sensors that had
> a common interface/info to be analyzed. It took a bit to figure out how to
> deal with this. It certainly wasn't convenient.
> Imagine the tuple type hierarchy:
> class Base {};
> class Derived1 extends Base {};
> TStream<Derived1> sDerived1 = ...; // ingest
> class Derived2 extends Base {};
> TStream<Derived2> sDerived2 = ...; // ingest
> TStream<Base> sBase = sDerived1.union( sDerived2 );
> doAnalytics( sBase );
> The union() gets a compilation error because TStream<Derived*> doesn't extend
> TStream<Base>. Std java generics stuff. A straightforward cast doesn't
> work; it requires a bit more convoluted casting.
> [I'll capture the essence of a thread on the dev list for this below]
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)