Package gnu.mapping

Class ArgListImpl

java.lang.Object
gnu.mapping.ArgListImpl
All Implemented Interfaces:
ArgList, ArgListBuilder
Direct Known Subclasses:
CallContext

public class ArgListImpl extends Object implements ArgList, ArgListBuilder
  • Field Details

    • count

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

    • ArgListImpl

      public ArgListImpl()
    • ArgListImpl

      public ArgListImpl(ArgListImpl args)
  • Method Details

    • 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)
    • clear

      public void clear()
      Specified by:
      clear in interface ArgListBuilder
    • setArgs

      public void setArgs()
      Specified by:
      setArgs in interface ArgListBuilder
    • setArgs

      public void setArgs(Object arg0)
      Specified by:
      setArgs in interface ArgListBuilder
    • setArgs

      public void setArgs(Object arg0, Object arg1)
      Specified by:
      setArgs in interface ArgListBuilder
    • setArgs

      public void setArgs(Object arg0, Object arg1, Object arg2)
      Specified by:
      setArgs in interface ArgListBuilder
    • setArgs

      public void setArgs(Object arg0, Object arg1, Object arg2, Object arg3)
      Specified by:
      setArgs in interface ArgListBuilder
    • setArgsAll

      public void setArgsAll(Object[] args)
    • setArgsAll

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

      public void add(Object arg)
      Specified by:
      add in interface ArgListBuilder
    • add

      public void add(Object arg0, Object arg1, Object arg2, Object arg3)
    • addAll

      public void addAll(ArgList args)
      Specified by:
      addAll in interface ArgListBuilder
    • addSequence

      public void addSequence(Object args)
    • addArgList

      public void addArgList(Object args)
    • addAll

      public void addAll(List<?> args)
      Specified by:
      addAll in interface ArgListBuilder
    • 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
    • firstKeyword

      public int firstKeyword()
      Specified by:
      firstKeyword in interface ArgList
    • numKeywords

      public int numKeywords()
      Specified by:
      numKeywords 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
    • asArgList

      public ArgList asArgList()
      Specified by:
      asArgList in interface ArgListBuilder
    • asFreshArgList

      public ArgList asFreshArgList()
      Specified by:
      asFreshArgList in interface ArgListBuilder