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. 036 * Unit<Length> PATHU_METER = PATHU(METER); </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 - Sanskritized version</a> * 043 * @draft 2.1 044 */ 045// FIXME Update 046public enum TamilSanskritPrefix implements Prefix { 047 /** <p> 048 * ௰ (pathu) 049 * </p> Prefix for 10<sup>21</sup>. */ 050 PATHU("P", 10, 1), 051 /** Prefix for 10<sup>18</sup>. */ 052 nūru("S", 10, 2), 053 /** Prefix for 10<sup>15</sup>. */ 054 āyiram("SA", 10, 3), 055 /** Prefix for 10<sup>12</sup>. */ 056 pattāyiram("Lk", 10, 4), 057 /** Prefix for 10<sup>9</sup>. */ 058 nūraiyiram("Cr", 10, 5), 059 /** Prefix for 10<sup>6</sup>. */ 060 meiyyiram("A", 10, 6), 061 /** Prefix for 10<sup>3</sup>. */ 062 tollun("K", 10, 9), 063 /** Prefix for 10<sup>2</sup>. */ 064 īkiyam("N", 10, 12), 065 /** Prefix for 10<sup>1</sup>. */ 066 neļai("Pa", 10, 15), 067 /** Prefix for 10<sup>-1</sup>. */ 068 iļañci("SH", 10, 18), 069 /** Prefix for 10<sup>-2</sup>. */ 070 veļļam("M", 10, 20), 071 /** Prefix for 10<sup>-2</sup>. */ 072 āmpal("M", 10, 21); 073 074 075 /** 076 * The symbol of this prefix, as returned by {@link #getSymbol}. 077 * 078 * @serial 079 * @see #getSymbol() 080 */ 081 private final String symbol; 082 083 /** 084 * Base part of the associated factor in base^exponent representation. 085 */ 086 private final int base; 087 088 /** 089 * Exponent part of the associated factor in base^exponent representation. 090 */ 091 private final int exponent; 092 093 /** 094 * Creates a new prefix. 095 * 096 * @param symbol 097 * the symbol of this prefix. 098 * @param exponent 099 * part of the associated factor in base^exponent representation. 100 */ 101 private TamilSanskritPrefix(String symbol, int base, int exponent) { 102 this.symbol = symbol; 103 this.base = base; 104 this.exponent = exponent; 105 } 106 107 /** 108 * Base part of the associated factor in {@code base^exponent} representation. 109 */ 110 @Override 111 public Integer getValue() { 112 return base; 113 } 114 115 116 /** 117 * Exponent part of the associated factor in base^exponent representation. 118 */ 119 @Override 120 public int getExponent() { 121 return exponent; 122 } 123 124 /** 125 * Returns the name of this prefix. 126 * 127 * @return this prefix name, not {@code null}. 128 */ 129 @Override 130 public String getName() { 131 return name(); 132 } 133 134 /** 135 * Returns the symbol of this prefix. 136 * 137 * @return this prefix symbol, not {@code null}. 138 */ 139 @Override 140 public String getSymbol() { 141 return symbol; 142 } 143}