Package gnu.mapping

Class ArgListImpl

    • Field Detail

      • count

        protected int count
        Number of arguments. Includes keyword arguments but does not include the keywords themselves.
    • Constructor Detail

      • ArgListImpl

        public ArgListImpl()
      • ArgListImpl

        public ArgListImpl​(ArgListImpl args)
    • Method Detail

      • printArgs

        public void printArgs()
      • numArguments

        public int numArguments()
        Description copied from interface: ArgList
        Number of actual arguments. Each (keyword,argument)-pair counts as one (not two).
        Specified by:
        numArguments in interface ArgList
      • popLast

        public Object popLast()
      • shiftArgs

        public void shiftArgs​(int toDrop)
      • setArgsAll

        public void setArgsAll​(Object[] args)
      • setArgsAll

        public void setArgsAll​(Object[] args,
                               int fromIndex,
                               int toIndex)
      • addSequence

        public void addSequence​(Object args)
      • addArgList

        public void addArgList​(Object args)
      • addKey

        public void addKey​(String keyword,
                           Object arg)
        Specified by:
        addKey in interface ArgListBuilder
        Parameters:
        keyword - must be an interned String
        arg - the corresponding value
      • getArgAsObject

        public Object getArgAsObject​(int i)
        Description copied from interface: ArgList
        Index into arguments, not counting keywords. I.e. for [a b k1: c k2: d e] the index 0 returns a, 2 returns c, 3 returns d, 4 returns e.
        Specified by:
        getArgAsObject in interface ArgList
      • getKeyword

        public String getKeyword​(int index)
        Description copied from interface: ArgList
        Get keyword (as an interned String) for given argument. Indexing is the same as getArgAsObject. Return null for non-keyword arguments.
        Specified by:
        getKeyword in interface ArgList
      • findKeyword

        public static int findKeyword​(ArgList args,
                                      String key)
      • findKeyword

        public int findKeyword​(String key)
        Description copied from interface: ArgList
        Find index for keyword.
        Specified by:
        findKeyword in interface ArgList
        Parameters:
        key - an interned string
      • setKeys

        public void setKeys​(int numKeywords,
                            String[] keys,
                            short[] sorted)
        Description copied from interface: ArgListBuilder
        Note the the previous numKeywords arguments were keywords arguments.
        Specified by:
        setKeys in interface ArgListBuilder