Connecting Tech Pros Worldwide Help | Site Map

Templates problem

 
LinkBack Thread Tools Search this Thread
  #1  
Old October 7th, 2008, 03:45 PM
Newbie
 
Join Date: Sep 2008
Posts: 9
Default Templates problem

Hi,

if there is:
Expand|Select|Wrap|Line Numbers
  1. public class Range<T extends Comparable<T>> extends Scope<T> implements Cloneable
, can I define this one:
Expand|Select|Wrap|Line Numbers
  1. public class RangeList<T extends Comparable<T>, R extends Range<T>> extends ArrayList<R>
without giving "T extends Comparable<T>"?

It would be perfect to say:
Expand|Select|Wrap|Line Numbers
  1. RangeList<R extends Range<T extends Comparable<T>>>
:).

Thanks in advance,
Etam.
Reply
  #2  
Old October 7th, 2008, 03:53 PM
Newbie
 
Join Date: Sep 2008
Posts: 9
Default

Maybe it is not related but RangeList<Date, Timerange> duties, has:
Expand|Select|Wrap|Line Numbers
  1. public final void crop(List<Range<T>> ranges)
method, and I can't pass List<Timerange> there (Timerange extends Range<Date> :/.

I have to do this:
Expand|Select|Wrap|Line Numbers
  1. List<Timerange> list = dateType.filter(starts, ends);
  2. List<Range<Date>> l = new ArrayList<Range<Date>>();
  3. Collections.copy(l, list);
  4. duties.crop(l);
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.