001/** 002 * 003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved. 004 * 005 * This library is free software; you can redistribute it and/or 006 * modify it under the terms of the GNU Lesser General Public 007 * License as published by the Free Software Foundation; either 008 * version 2.1 of the License, or (at your option) any later version. 009 * 010 * This library is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 013 * Lesser General Public License for more details. 014 * 015 * You should have received a copy of the GNU Lesser General Public 016 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 017 * 018 **/ 019package lucee.runtime.type.scope; 020 021import lucee.runtime.op.Caster; 022import lucee.runtime.type.KeyImpl; 023 024public final class ArgumentIntKey extends KeyImpl { 025 026 private static final ArgumentIntKey[] KEYS = new ArgumentIntKey[]{ 027 new ArgumentIntKey(0), 028 new ArgumentIntKey(1), 029 new ArgumentIntKey(2), 030 new ArgumentIntKey(3), 031 new ArgumentIntKey(4), 032 new ArgumentIntKey(5), 033 new ArgumentIntKey(6), 034 new ArgumentIntKey(7), 035 new ArgumentIntKey(8), 036 new ArgumentIntKey(9), 037 new ArgumentIntKey(10), 038 new ArgumentIntKey(11), 039 new ArgumentIntKey(12), 040 new ArgumentIntKey(13), 041 new ArgumentIntKey(14), 042 new ArgumentIntKey(15), 043 new ArgumentIntKey(16), 044 new ArgumentIntKey(17), 045 }; 046 047 private int intKey; 048 049 public ArgumentIntKey(int key) { 050 super(Caster.toString(key)); 051 052 this.intKey=key; 053 } 054 055 public int getIntKey() { 056 return intKey; 057 } 058 059 public static ArgumentIntKey init(int i) { 060 if(i>=0 && i<KEYS.length) return KEYS[i]; 061 return new ArgumentIntKey(i); 062 } 063}