< prev index next >

src/java.base/share/classes/java/lang/Character.java

Print this page
rev 12008 : [mq]: XXXXXXX-Remove-INITIAL_CAPACITY-constant


 632             return name;
 633         }
 634     }
 635 
 636     // See http://www.unicode.org/Public/UNIDATA/Blocks.txt
 637     // for the latest specification of Unicode Blocks.
 638 
 639     /**
 640      * A family of character subsets representing the character blocks in the
 641      * Unicode specification. Character blocks generally define characters
 642      * used for a specific script or purpose. A character is contained by
 643      * at most one Unicode block.
 644      *
 645      * @since 1.2
 646      */
 647     public static final class UnicodeBlock extends Subset {
 648         /**
 649          * 510  - the expected number of enteties
 650          * 0.75 - the default load factor of HashMap
 651          */
 652         private static final int INITIAL_CAPACITY =
 653                 (int)(510 / 0.75f + 1.0f);
 654         private static Map<String, UnicodeBlock> map =
 655                 new HashMap<>(INITIAL_CAPACITY);
 656 
 657         /**
 658          * Creates a UnicodeBlock with the given identifier name.
 659          * This name must be the same as the block identifier.
 660          */
 661         private UnicodeBlock(String idName) {
 662             super(idName);
 663             map.put(idName, this);
 664         }
 665 
 666         /**
 667          * Creates a UnicodeBlock with the given identifier name and
 668          * alias name.
 669          */
 670         private UnicodeBlock(String idName, String alias) {
 671             this(idName);
 672             map.put(alias, this);
 673         }
 674 
 675         /**




 632             return name;
 633         }
 634     }
 635 
 636     // See http://www.unicode.org/Public/UNIDATA/Blocks.txt
 637     // for the latest specification of Unicode Blocks.
 638 
 639     /**
 640      * A family of character subsets representing the character blocks in the
 641      * Unicode specification. Character blocks generally define characters
 642      * used for a specific script or purpose. A character is contained by
 643      * at most one Unicode block.
 644      *
 645      * @since 1.2
 646      */
 647     public static final class UnicodeBlock extends Subset {
 648         /**
 649          * 510  - the expected number of enteties
 650          * 0.75 - the default load factor of HashMap
 651          */


 652         private static Map<String, UnicodeBlock> map =
 653                 new HashMap<>((int)(510 / 0.75f + 1.0f));
 654 
 655         /**
 656          * Creates a UnicodeBlock with the given identifier name.
 657          * This name must be the same as the block identifier.
 658          */
 659         private UnicodeBlock(String idName) {
 660             super(idName);
 661             map.put(idName, this);
 662         }
 663 
 664         /**
 665          * Creates a UnicodeBlock with the given identifier name and
 666          * alias name.
 667          */
 668         private UnicodeBlock(String idName, String alias) {
 669             this(idName);
 670             map.put(alias, this);
 671         }
 672 
 673         /**


< prev index next >