generics: how to tell more about the parameter?



Hi!

I'd like to promise certain things about the parameter of a generic:

public class Foo<Bar implements Something> {
...
}

but that's a syntax error immediately -- javac expects a closing `>' right
where the space after `Bar' is in the above example...

How can I do this -- so that I can rely on Bar's features inside Foo and
have the compiler enforce the possible Bar's compliance?

Thanks!

-mi
.



Relevant Pages

  • Re: Wrapper class
    ... situations you should probably have a look at the proxy/decorator patterns ... public class FooProxy: Foo{ ... public override void Bar() { ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Newbie question - Disadvantages of java
    ... >> as I am about to switch to java, can somebody tell me the biggest ... public class Foo { ... public Foo getFoo() { ... I.e. primitive types, references and array references? ...
    (comp.lang.java.programmer)
  • Re: a case for multiple inheritance
    ... FYI The 'new' modifier will define a method as hiding a derived one, ... private new void Foo ... If you want to expose two read-only lists from your ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: static virtual/override
    ... > I sorely miss the feature that permits ... > public class Bar: Foo ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: XmlSerializer: Inheritance and Read-Only Properties
    ... > public class Bar: Foo ... > public string Message ...
    (microsoft.public.dotnet.xml)