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


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

enum syntax

Path csiph.com!feeder.erje.net!1.us.feeder.erje.net!news.linkpendium.com!news.linkpendium.com!panix!not-for-mail
From ruben safir <ruben@mrbrklyn.com>
Newsgroups comp.lang.java.programmer
Subject enum syntax
Date Sat, 7 May 2016 23:58:42 -0400
Organization PANIX Public Access Internet and UNIX, NYC
Lines 50
Message-ID <ngmdhi$ics$1@reader1.panix.com> (permalink)
NNTP-Posting-Host www.mrbrklyn.com
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 7bit
X-Trace reader1.panix.com 1462679922 18844 96.57.23.82 (8 May 2016 03:58:42 GMT)
X-Complaints-To abuse@panix.com
NNTP-Posting-Date Sun, 8 May 2016 03:58:42 +0000 (UTC)
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0
Xref csiph.com comp.lang.java.programmer:34260

Show key headers only | View raw


How is there no closing paran and a method included as an enum entry?

what is this syntax ?


/**
 * An enumeration representing all base types in Calc. It also includes
 * the ERROR designation, used by the type checker to propagate errors.
 */
public enum Type {
    INT,
    FLOAT,
    BOOL,
    STRING,
    ERROR;

    /**
     * The types form a hierarchy, with ERROR at the root.
     * @return The least upper bound of this and that.
     */
    public Type leastUpperBound(Type that) {
        if(this == that)
            return this;
        if((this == INT && that == FLOAT)
            ||(this == FLOAT && that == INT))
            return FLOAT;
        return ERROR;
    }

    /**
     * Determines whether the type is numeric, defined as INT or FLOAT.
     */
    public boolean isNumeric() {
        return leastUpperBound(FLOAT) == FLOAT;
    }
}
-- 
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive
http://www.coinhangout.com - coins!
http://www.brooklyn-living.com

Being so tracked is for FARM ANIMALS and and extermination camps,
but incompatible with living as a free human being. -RI Safir 2013

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


Thread

enum syntax ruben safir <ruben@mrbrklyn.com> - 2016-05-07 23:58 -0400
  Re: enum syntax Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2016-05-07 21:43 -0700
    Re: enum syntax Roedy Green <inquiry@mindprod.com> - 2016-07-12 04:35 -0700
  Re: enum syntax Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-08 07:22 -0400
  Re: enum syntax Roedy Green <see_website@mindprod.com.invalid> - 2016-05-20 18:01 -0700

csiph-web