Package gnu.expr

Class GenericProc

  • All Implemented Interfaces:
    Named

    public class GenericProc
    extends MethodProc
    A collection of MethodProcs; one is chosen at apply time.
    • Constructor Detail

      • GenericProc

        public GenericProc​(String name)
      • GenericProc

        public GenericProc()
    • Method Detail

      • getMethodCount

        public int getMethodCount()
      • getMethod

        public MethodProc getMethod​(int i)
      • numArgs

        public int numArgs()
        Description copied from class: Procedure
        Return minArgs()|(maxArgs<<12). We use a single virtual function to reduce the number of methods in the system, as well as the number of virtual method table entries. We shift by 12 so the number can normally be represented using a sipush instruction, without requiring a constant pool entry.
        Overrides:
        numArgs in class Procedure
      • addAll

        protected void addAll​(MethodProc[] procs)
      • addAtEnd

        public void addAtEnd​(MethodProc method)
      • isApplicable

        public int isApplicable​(Type[] args,
                                Type restType)
        Description copied from class: MethodProc
        Test if method is applicable to an invocation with given arguments.
        Overrides:
        isApplicable in class MethodProc
        Parameters:
        args - array of known "single" arguments.
        restType - If null, the arguments are fully specified by argTypes. If non-null, there may be an unknown number of extra arguments of the given restType. This is used for splices, where we usually don't know at compile-time how many argument values we have.
        Returns:
        -1 if no; 1 if yes; 0 if need to check at run-time.
      • setProperty

        public void setProperty​(Keyword key,
                                Object value)
      • setProperties

        public final void setProperties​(Object[] args)
      • make

        public static GenericProc make​(Object[] args)
        Create a GenericProc from one or more methods, plus properties.
      • makeWithoutSorting

        public static GenericProc makeWithoutSorting​(Object... args)