public int installFunction(String name, Class func)
  {

    int funcIndex;
    Object funcIndexObj = getFunctionID(name);

    if (null != funcIndexObj)
    {
      funcIndex = ((Integer) funcIndexObj).intValue();
      
      if (funcIndex < NUM_BUILT_IN_FUNCS){
              funcIndex = m_funcNextFreeIndex++;
              m_functionID_customer.put(name, new Integer(funcIndex)); 
      }
      m_functions_customer[funcIndex - NUM_BUILT_IN_FUNCS] = func;          
    }
    else
    {
            funcIndex = m_funcNextFreeIndex++;
                          
            m_functions_customer[funcIndex-NUM_BUILT_IN_FUNCS] = func;
                    
            m_functionID_customer.put(name, 
                new Integer(funcIndex));   
    }
    return funcIndex;
  }
public int installFunction ( String name , Class func ) { int funcIndex ; Object funcIndexObj = getFunctionID ( name ) ; if ( null != funcIndexObj ) { funcIndex = ( ( Integer ) funcIndexObj ) . intValue ( ) ; if ( funcIndex < NUM_BUILT_IN_FUNCS ) { funcIndex = m_funcNextFreeIndex ++ ; m_functionID_customer . put ( name , new Integer ( funcIndex ) ) ; } m_functions_customer [ funcIndex - NUM_BUILT_IN_FUNCS ] = func ; } else { funcIndex = m_funcNextFreeIndex ++ ; m_functions_customer [ funcIndex - NUM_BUILT_IN_FUNCS ] = func ; m_functionID_customer . put ( name , new Integer ( funcIndex ) ) ; } return funcIndex ; }
Install a built-in function.
@param name The unqualified name of the function, must not be null
@param func A Implementation of an XPath Function object.
@return the position of the function in the internal index.