⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 functiontable.java

📁 java1.6众多例子参考
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/* * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * *     http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *//* * $Id: FunctionTable.java,v 1.3 2005/09/28 13:49:34 pvedula Exp $ */package com.sun.org.apache.xpath.internal.compiler;import com.sun.org.apache.xpath.internal.Expression;import com.sun.org.apache.xpath.internal.functions.Function;import java.util.HashMap;import javax.xml.transform.TransformerException;/** * The function table for XPath. */public class FunctionTable{  /** The 'current()' id. */  public static final int FUNC_CURRENT = 0;  /** The 'last()' id. */  public static final int FUNC_LAST = 1;  /** The 'position()' id. */  public static final int FUNC_POSITION = 2;  /** The 'count()' id. */  public static final int FUNC_COUNT = 3;  /** The 'id()' id. */  public static final int FUNC_ID = 4;  /** The 'key()' id (XSLT). */  public static final int FUNC_KEY = 5;  /** The 'local-name()' id. */  public static final int FUNC_LOCAL_PART = 7;  /** The 'namespace-uri()' id. */  public static final int FUNC_NAMESPACE = 8;  /** The 'name()' id. */  public static final int FUNC_QNAME = 9;  /** The 'generate-id()' id. */  public static final int FUNC_GENERATE_ID = 10;  /** The 'not()' id. */  public static final int FUNC_NOT = 11;  /** The 'true()' id. */  public static final int FUNC_TRUE = 12;  /** The 'false()' id. */  public static final int FUNC_FALSE = 13;  /** The 'boolean()' id. */  public static final int FUNC_BOOLEAN = 14;  /** The 'number()' id. */  public static final int FUNC_NUMBER = 15;  /** The 'floor()' id. */  public static final int FUNC_FLOOR = 16;  /** The 'ceiling()' id. */  public static final int FUNC_CEILING = 17;  /** The 'round()' id. */  public static final int FUNC_ROUND = 18;  /** The 'sum()' id. */  public static final int FUNC_SUM = 19;  /** The 'string()' id. */  public static final int FUNC_STRING = 20;  /** The 'starts-with()' id. */  public static final int FUNC_STARTS_WITH = 21;  /** The 'contains()' id. */  public static final int FUNC_CONTAINS = 22;  /** The 'substring-before()' id. */  public static final int FUNC_SUBSTRING_BEFORE = 23;  /** The 'substring-after()' id. */  public static final int FUNC_SUBSTRING_AFTER = 24;  /** The 'normalize-space()' id. */  public static final int FUNC_NORMALIZE_SPACE = 25;  /** The 'translate()' id. */  public static final int FUNC_TRANSLATE = 26;  /** The 'concat()' id. */  public static final int FUNC_CONCAT = 27;  /** The 'substring()' id. */  public static final int FUNC_SUBSTRING = 29;  /** The 'string-length()' id. */  public static final int FUNC_STRING_LENGTH = 30;  /** The 'system-property()' id. */  public static final int FUNC_SYSTEM_PROPERTY = 31;  /** The 'lang()' id. */  public static final int FUNC_LANG = 32;  /** The 'function-available()' id (XSLT). */  public static final int FUNC_EXT_FUNCTION_AVAILABLE = 33;  /** The 'element-available()' id (XSLT). */  public static final int FUNC_EXT_ELEM_AVAILABLE = 34;  /** The 'unparsed-entity-uri()' id (XSLT). */  public static final int FUNC_UNPARSED_ENTITY_URI = 36;  // Proprietary  /** The 'document-location()' id (Proprietary). */  public static final int FUNC_DOCLOCATION = 35;  /**   * The function table.   */  private static Class m_functions[];  /** Table of function name to function ID associations. */  private static HashMap m_functionID = new HashMap();      /**   * The function table contains customized functions   */  private Class m_functions_customer[] = new Class[NUM_ALLOWABLE_ADDINS];  /**   * Table of function name to function ID associations for customized functions   */  private HashMap m_functionID_customer = new HashMap();    /**   * Number of built in functions.  Be sure to update this as   * built-in functions are added.   */  private static final int NUM_BUILT_IN_FUNCS = 37;  /**   * Number of built-in functions that may be added.   */  private static final int NUM_ALLOWABLE_ADDINS = 30;  /**   * The index to the next free function index.   */  private int m_funcNextFreeIndex = NUM_BUILT_IN_FUNCS;    static  {    m_functions = new Class[NUM_BUILT_IN_FUNCS];    m_functions[FUNC_CURRENT] = com.sun.org.apache.xpath.internal.functions.FuncCurrent.class;    m_functions[FUNC_LAST] = com.sun.org.apache.xpath.internal.functions.FuncLast.class;    m_functions[FUNC_POSITION] = com.sun.org.apache.xpath.internal.functions.FuncPosition.class;    m_functions[FUNC_COUNT] = com.sun.org.apache.xpath.internal.functions.FuncCount.class;    m_functions[FUNC_ID] = com.sun.org.apache.xpath.internal.functions.FuncId.class;    // J2SE does not support Xalan interpretive    // m_functions[FUNC_KEY] =    //   com.sun.org.apache.xalan.internal.templates.FuncKey.class;    m_functions[FUNC_LOCAL_PART] =       com.sun.org.apache.xpath.internal.functions.FuncLocalPart.class;    m_functions[FUNC_NAMESPACE] =       com.sun.org.apache.xpath.internal.functions.FuncNamespace.class;    m_functions[FUNC_QNAME] = com.sun.org.apache.xpath.internal.functions.FuncQname.class;    m_functions[FUNC_GENERATE_ID] =       com.sun.org.apache.xpath.internal.functions.FuncGenerateId.class;    m_functions[FUNC_NOT] = com.sun.org.apache.xpath.internal.functions.FuncNot.class;    m_functions[FUNC_TRUE] = com.sun.org.apache.xpath.internal.functions.FuncTrue.class;    m_functions[FUNC_FALSE] = com.sun.org.apache.xpath.internal.functions.FuncFalse.class;    m_functions[FUNC_BOOLEAN] = com.sun.org.apache.xpath.internal.functions.FuncBoolean.class;    m_functions[FUNC_LANG] = com.sun.org.apache.xpath.internal.functions.FuncLang.class;    m_functions[FUNC_NUMBER] = com.sun.org.apache.xpath.internal.functions.FuncNumber.class;    m_functions[FUNC_FLOOR] = com.sun.org.apache.xpath.internal.functions.FuncFloor.class;    m_functions[FUNC_CEILING] = com.sun.org.apache.xpath.internal.functions.FuncCeiling.class;    m_functions[FUNC_ROUND] = com.sun.org.apache.xpath.internal.functions.FuncRound.class;    m_functions[FUNC_SUM] = com.sun.org.apache.xpath.internal.functions.FuncSum.class;    m_functions[FUNC_STRING] = com.sun.org.apache.xpath.internal.functions.FuncString.class;    m_functions[FUNC_STARTS_WITH] =       com.sun.org.apache.xpath.internal.functions.FuncStartsWith.class;    m_functions[FUNC_CONTAINS] = com.sun.org.apache.xpath.internal.functions.FuncContains.class;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -