Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #28747

Re: use case for extending enum, but this is not possible in java

From "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org>
Newsgroups comp.lang.java.programmer
References <lniljr$8h9$1@news.m-online.net>
Subject Re: use case for extending enum, but this is not possible in java
Date 2014-06-15 11:58 +0100
Message-ID <m8mdnb2Gwek04ADOnZ2dnUVZ8v-dnZ2d@bt.com> (permalink)

Show all headers | View raw


Laura Schmidt wrote:

> Now I am making a cut: The generic class Listing<T> should be moved into
> a generic java library, so that it can be used by different
> applications. So I also need to move the interface ListCommandProcesor
> into this library, and this would implicate that I also move the enum
> ListCommand into the library. But the enum ListCommand ist application
> specific.

Think objects not integers (Java's enums aren't "integers in drag" anyway).

You have these command "things".  What does the general library need to know 
about them ?  Anything ?  If not then declare them as java.lang.Object. 
Otherwise either use an interface or generics (or both) to express the 
constraints on them.

    -- chris 

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

use case for extending enum, but this is not possible in java Laura Schmidt <ls@mailinator.com> - 2014-06-15 01:24 +0200
  Re: use case for extending enum, but this is not possible in java Steven Simpson <ss@domain.invalid> - 2014-06-15 01:04 +0100
  Re: use case for extending enum, but this is not possible in java Marcel Müller <news.5.maazl@spamgourmet.org> - 2014-06-15 02:53 +0200
  Re: use case for extending enum, but this is not possible in java markspace <markspace@nospam.nospam> - 2014-06-14 18:58 -0700
  Re: use case for extending enum, but this is not possible in java Robert Klemme <shortcutter@googlemail.com> - 2014-06-15 12:20 +0200
  Re: use case for extending enum, but this is not possible in java Robert Klemme <shortcutter@googlemail.com> - 2014-06-15 12:21 +0200
  Re: use case for extending enum, but this is not possible in java "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2014-06-15 11:58 +0100
  Re: use case for extending enum, but this is not possible in java Wanja Gayk <brixomatic@yahoo.com> - 2014-06-16 01:08 +0200
  Re: use case for extending enum, but this is not possible in java Roedy Green <see_website@mindprod.com.invalid> - 2014-06-15 22:20 -0700

csiph-web