Jump to content


Check out our Community Blogs

ThemePark

Member Since 14 Oct 2008
Offline Last Active Oct 16 2015 05:45 PM
-----

#626974 Boolean Pattern Matching In Postgresql

Posted by ThemePark on 15 April 2012 - 12:01 PM

Thanks, with your idea I ended up using SELECT count(*), substr(...) || substr(...) ...

I thought I had to use count(substr(...)) to get the count for each string, but with count(*) it works perfectly.
  • 1


#626887 Extending Generic Class And Comparable With Sub Class

Posted by ThemePark on 14 April 2012 - 11:17 PM

I've been using generics for a while, but I've hit a wall. Suppose I have these two classes.

public abstract class SuperA<T>
public class SubA extends SuperA<Integer>

Now I want SuperA to extend Comparable, but in such a way that when I override compareTo in SubA, it compares to a SubA object, not a SuperA object. So like this.

public int compareTo(SubA o)

I've tried various versions of

public abstract class SuperA<E extends SuperA<T>> extends Comparable<E>

but I get compile errors on all suggestions. So what exactly is the syntax to get a compareTo method like the one I have shown?
  • 1


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download