Path: blob/aarch64-shenandoah-jdk8u272-b10/langtools/src/share/classes/com/sun/tools/doclint/Entity.java
38899 views
/*1* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package com.sun.tools.doclint;2627import java.util.HashMap;28import java.util.Map;2930/**31* Table of entities defined in HTML 4.01.32*33* <p> Derived from34* <a href="http://www.w3.org/TR/html4/sgml/entities.html">Character entity references in HTML 4</a>.35*36* The name of the member follows the name of the entity,37* except when it clashes with a keyword, in which case38* it is prefixed by '_'.39*40* <p><b>This is NOT part of any supported API.41* If you write code that depends on this, you do so at your own42* risk. This code and its internal interfaces are subject to change43* or deletion without notice.</b></p>44*/45public enum Entity {46nbsp(160),47iexcl(161),48cent(162),49pound(163),50curren(164),51yen(165),52brvbar(166),53sect(167),54uml(168),55copy(169),56ordf(170),57laquo(171),58not(172),59shy(173),60reg(174),61macr(175),62deg(176),63plusmn(177),64sup2(178),65sup3(179),66acute(180),67micro(181),68para(182),69middot(183),70cedil(184),71sup1(185),72ordm(186),73raquo(187),74frac14(188),75frac12(189),76frac34(190),77iquest(191),78Agrave(192),79Aacute(193),80Acirc(194),81Atilde(195),82Auml(196),83Aring(197),84AElig(198),85Ccedil(199),86Egrave(200),87Eacute(201),88Ecirc(202),89Euml(203),90Igrave(204),91Iacute(205),92Icirc(206),93Iuml(207),94ETH(208),95Ntilde(209),96Ograve(210),97Oacute(211),98Ocirc(212),99Otilde(213),100Ouml(214),101times(215),102Oslash(216),103Ugrave(217),104Uacute(218),105Ucirc(219),106Uuml(220),107Yacute(221),108THORN(222),109szlig(223),110agrave(224),111aacute(225),112acirc(226),113atilde(227),114auml(228),115aring(229),116aelig(230),117ccedil(231),118egrave(232),119eacute(233),120ecirc(234),121euml(235),122igrave(236),123iacute(237),124icirc(238),125iuml(239),126eth(240),127ntilde(241),128ograve(242),129oacute(243),130ocirc(244),131otilde(245),132ouml(246),133divide(247),134oslash(248),135ugrave(249),136uacute(250),137ucirc(251),138uuml(252),139yacute(253),140thorn(254),141yuml(255),142fnof(402),143Alpha(913),144Beta(914),145Gamma(915),146Delta(916),147Epsilon(917),148Zeta(918),149Eta(919),150Theta(920),151Iota(921),152Kappa(922),153Lambda(923),154Mu(924),155Nu(925),156Xi(926),157Omicron(927),158Pi(928),159Rho(929),160Sigma(931),161Tau(932),162Upsilon(933),163Phi(934),164Chi(935),165Psi(936),166Omega(937),167alpha(945),168beta(946),169gamma(947),170delta(948),171epsilon(949),172zeta(950),173eta(951),174theta(952),175iota(953),176kappa(954),177lambda(955),178mu(956),179nu(957),180xi(958),181omicron(959),182pi(960),183rho(961),184sigmaf(962),185sigma(963),186tau(964),187upsilon(965),188phi(966),189chi(967),190psi(968),191omega(969),192thetasym(977),193upsih(978),194piv(982),195bull(8226),196hellip(8230),197prime(8242),198Prime(8243),199oline(8254),200frasl(8260),201weierp(8472),202image(8465),203real(8476),204trade(8482),205alefsym(8501),206larr(8592),207uarr(8593),208rarr(8594),209darr(8595),210harr(8596),211crarr(8629),212lArr(8656),213uArr(8657),214rArr(8658),215dArr(8659),216hArr(8660),217forall(8704),218part(8706),219exist(8707),220empty(8709),221nabla(8711),222isin(8712),223notin(8713),224ni(8715),225prod(8719),226sum(8721),227minus(8722),228lowast(8727),229radic(8730),230prop(8733),231infin(8734),232ang(8736),233and(8743),234or(8744),235cap(8745),236cup(8746),237_int(8747),238there4(8756),239sim(8764),240cong(8773),241asymp(8776),242ne(8800),243equiv(8801),244le(8804),245ge(8805),246sub(8834),247sup(8835),248nsub(8836),249sube(8838),250supe(8839),251oplus(8853),252otimes(8855),253perp(8869),254sdot(8901),255lceil(8968),256rceil(8969),257lfloor(8970),258rfloor(8971),259lang(9001),260rang(9002),261loz(9674),262spades(9824),263clubs(9827),264hearts(9829),265diams(9830),266quot(34),267amp(38),268lt(60),269gt(62),270OElig(338),271oelig(339),272Scaron(352),273scaron(353),274Yuml(376),275circ(710),276tilde(732),277ensp(8194),278emsp(8195),279thinsp(8201),280zwnj(8204),281zwj(8205),282lrm(8206),283rlm(8207),284ndash(8211),285mdash(8212),286lsquo(8216),287rsquo(8217),288sbquo(8218),289ldquo(8220),290rdquo(8221),291bdquo(8222),292dagger(8224),293Dagger(8225),294permil(8240),295lsaquo(8249),296rsaquo(8250),297euro(8364);298299int code;300301private Entity(int code) {302this.code = code;303}304305static boolean isValid(String name) {306return names.containsKey(name);307}308309static boolean isValid(int code) {310// allow numeric codes for standard ANSI characters311return codes.containsKey(code) || ( 32 <= code && code < 2127);312}313314private static final Map<String,Entity> names = new HashMap<String,Entity>();315private static final Map<Integer,Entity> codes = new HashMap<Integer,Entity>();316static {317for (Entity e: values()) {318String name = e.name();319int code = e.code;320if (name.startsWith("_")) name = name.substring(1);321names.put(name, e);322codes.put(code, e);323}324}325}326327328