001/* 002 * Units of Measurement Systems 003 * Copyright (c) 2005-2021, Jean-Marie Dautelle, Werner Keil and others. 004 * 005 * All rights reserved. 006 * 007 * Redistribution and use in source and binary forms, with or without modification, 008 * are permitted provided that the following conditions are met: 009 * 010 * 1. Redistributions of source code must retain the above copyright notice, 011 * this list of conditions and the following disclaimer. 012 * 013 * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions 014 * and the following disclaimer in the documentation and/or other materials provided with the distribution. 015 * 016 * 3. Neither the name of JSR-385, Units of Measurement nor the names of their contributors may be used to 017 * endorse or promote products derived from this software without specific prior written permission. 018 * 019 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 020 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 021 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 022 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 023 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 024 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 025 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 026 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 027 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 028 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 029 */ 030package systems.uom.common.historic; 031 032import javax.measure.Prefix; 033 034/** 035 * Utility class holding traditional numbers of the Ancient Tamil Country, Tamizhakam.<br> 036 * <code>{@literal Unit<Length>} NURU_METER = METER.prefix(NURU); </code> 037 * 038 * @author <a href="mailto:werner@uom.systems">Werner Keil</a> 039 * @version 1.1, $Date: 2021-03-29 $ 040 * @see <a 041 * href="http://en.wikipedia.org/wiki/Tamil_units_of_measurement#Whole_numbers">Wikipedia: 042 * Tamil units of measurement - Whole numbers</a> 043 * @draft 3 044 */ 045public enum TamilAncientPrefix implements Prefix { 046 /** <p> 047 * ௰ (pathu) 048 * </p> Prefix for 10<sup>1</sup>. */ 049 PATHU("௰", "pathu", 10, 1), 050 /** Prefix for 10<sup>2</sup>. */ 051 NURU("௱", "nūru", 10, 2), 052 /** Prefix for 10<sup>15</sup>. */ 053 AYIRAM("௲", "āyiram", 10, 3), 054 /** Prefix for 10<sup>4</sup>. */ 055 PATTAYIRAM("௰௲", "pattāyiram", 10, 4), 056 /** Prefix for 10<sup>9</sup>. */ 057 NURAIYIRAM("௱௲", "nūraiyiram", 10, 5), 058 /** Prefix for 10<sup>6</sup>. */ 059 MEIYYIRAM("௲௲", "meiyyiram", 10, 6), 060 /** Prefix for 10<sup>9</sup>. */ 061 TOLLUN("௲௲௲", "tollun", 10, 9), 062 /** Prefix for 10<sup>12</sup>. */ 063 IKIYAM("௲௲௲௲", "īkiyam", 10, 12), 064 /** Prefix for 10<sup>1</sup>. */ 065 NELAI("௲௲௲௲௲", "neļai", 10, 15), 066 /** Prefix for 10<sup>18</sup>. */ 067 ILANCI("௲௲௲௲௲௲", "iļañci", 10, 18), 068 /** Prefix for 10<sup>20</sup>. */ 069 VELLAM("௱௲௲௲௲௲௲", "veļļam", 10, 20), 070 /** Prefix for 10<sup>21</sup>. */ 071 AMPAL("௲௲௲௲௲௲௲", "āmpal", 10, 21); 072 073 /** 074 * The symbol of this prefix, as returned by {@link #getSymbol}. 075 * 076 * @serial 077 * @see #getSymbol() 078 */ 079 private final String symbol; 080 081 /** 082 * The name of this prefix, as returned by {@link #getName}. 083 * 084 * @serial 085 * @see #getName() 086 */ 087 private final String name; 088 089 /** 090 * Base part of the associated factor in base^exponent representation. 091 */ 092 private final int base; 093 094 /** 095 * Exponent part of the associated factor in base^exponent representation. 096 */ 097 private final int exponent; 098 099 /** 100 * Creates a new prefix. 101 * 102 * @param symbol 103 * the symbol of this prefix. 104 * @param name 105 * the (display) name of this prefix. 106 * @param exponent 107 * part of the associated factor in base^exponent representation. 108 */ 109 private TamilAncientPrefix(String symbol, String name, int base, int exponent) { 110 this.symbol = symbol; 111 this.name = name; 112 this.base = base; 113 this.exponent = exponent; 114 } 115 116 /** 117 * Base part of the associated factor in {@code base^exponent} representation. 118 */ 119 @Override 120 public Integer getValue() { 121 return base; 122 } 123 124 125 /** 126 * Exponent part of the associated factor in base^exponent representation. 127 */ 128 @Override 129 public int getExponent() { 130 return exponent; 131 } 132 133 /** 134 * Returns the name of this prefix. 135 * 136 * @return this prefix name, not {@code null}. 137 */ 138 @Override 139 public String getName() { 140 return name; 141 } 142 143 /** 144 * Returns the symbol of this prefix. 145 * 146 * @return this prefix symbol, not {@code null}. 147 */ 148 @Override 149 public String getSymbol() { 150 return symbol; 151 } 152}