From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,950b357d6db67d4e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-17 06:54:31 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: No Spam Newsgroups: comp.lang.ada Subject: Re: Contrained ada type in java Date: Wed, 17 Dec 2003 09:54:41 -0500 Organization: None Message-ID: References: X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:3504 Date: 2003-12-17T09:54:41-05:00 List-Id: Compare >| public boolean equals(Object obj) { >| // Assume proper type was given <<<<------ >| return (__level == ((Volume)obj).__level); >| } >| >| public int compareTo(Object obj) { >| // Assume proper type was given <<<<------ >| int other = ((Volume)obj).__level; With >| It is quite a lot of work just to get the functionality of >| enumerated types. Simply using integer constants will be sufficient >| for most programs, but when value restriction and type safety become <<<<------- >| issues, you will have to resort to some variation of the more >| complicated solution.