Class EmptyArgs

  • All Implemented Interfaces:
    IArgs

    public class EmptyArgs
    extends java.lang.Object
    implements IArgs
    Helper implementation for empty argument list.
    • Field Summary

      • Fields inherited from interface de.intarsys.tools.functor.IArgs

        ARG_ARGS
    • Constructor Summary

      Constructors 
      Constructor Description
      EmptyArgs()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(java.lang.Object object)  
      void clear()  
      IArgs declare​(java.lang.String name, int index, java.lang.Object value)  
      java.lang.Object get​(int index)
      The argument at position index.
      java.lang.Object get​(int index, java.lang.Object defaultValue)
      The argument at position index
      java.lang.Object get​(java.lang.String name)
      The argument named name.
      java.lang.Object get​(java.lang.String name, java.lang.Object defaultValue)
      The argument named name or the defaultValue if not available.
      boolean isDefined​(int index)
      true if an argument at index is defined.
      boolean isDefined​(java.lang.String name)
      true if an argument named name is defined.
      boolean isIndexed()
      true if this argument list is indexed.
      boolean isNamed()
      true if this argument list is named.
      java.util.Set names()
      The set of all argument names in the argument list if this argument list is not indexed or null.
      void put​(int index, java.lang.Object value)  
      void put​(java.lang.String name, java.lang.Object value)  
      int size()
      The total number of arguments.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • EmptyArgs

        public EmptyArgs()
    • Method Detail

      • add

        public void add​(java.lang.Object object)
        Specified by:
        add in interface IArgs
      • clear

        public void clear()
        Specified by:
        clear in interface IArgs
      • declare

        public IArgs declare​(java.lang.String name,
                             int index,
                             java.lang.Object value)
      • get

        public java.lang.Object get​(int index)
        Description copied from interface: IArgs
        The argument at position index.
        Specified by:
        get in interface IArgs
        Parameters:
        index - The index of the argument to return.
        Returns:
        The argument at position index.
      • get

        public java.lang.Object get​(int index,
                                    java.lang.Object defaultValue)
        Description copied from interface: IArgs
        The argument at position index
        Specified by:
        get in interface IArgs
        Parameters:
        index - The index of the argument to return.
        defaultValue - The default value to be returned if argument is not available.
        Returns:
        The argument at position index
      • get

        public java.lang.Object get​(java.lang.String name)
        Description copied from interface: IArgs
        The argument named name.
        Specified by:
        get in interface IArgs
        Parameters:
        name - The name of the argument to return.
        Returns:
        The argument named name .
      • get

        public java.lang.Object get​(java.lang.String name,
                                    java.lang.Object defaultValue)
        Description copied from interface: IArgs
        The argument named name or the defaultValue if not available.
        Specified by:
        get in interface IArgs
        Parameters:
        name - The name of the argument to return.
        defaultValue - The default value to be returned if argument is not available.
        Returns:
        The argument named name
      • isDefined

        public boolean isDefined​(int index)
        Description copied from interface: IArgs
        true if an argument at index is defined.
        Specified by:
        isDefined in interface IArgs
        Returns:
        true if an argument at index is defined.
      • isDefined

        public boolean isDefined​(java.lang.String name)
        Description copied from interface: IArgs
        true if an argument named name is defined.
        Specified by:
        isDefined in interface IArgs
        Returns:
        true if an argument named name is defined.
      • isIndexed

        public boolean isIndexed()
        Description copied from interface: IArgs
        true if this argument list is indexed. This means its elements are available via integer indexes.

        This does NOT mean the arguments are not available via names - there are implementations that can support both.

        Specified by:
        isIndexed in interface IArgs
        Returns:
        true if this argument list is indexed.
      • isNamed

        public boolean isNamed()
        Description copied from interface: IArgs
        true if this argument list is named. This means its elements are available via names.

        This does NOT mean the arguments are not available via indexes - there are implementations that can support both.

        Specified by:
        isNamed in interface IArgs
        Returns:
        true if this argument list is named.
      • names

        public java.util.Set names()
        Description copied from interface: IArgs
        The set of all argument names in the argument list if this argument list is not indexed or null.
        Specified by:
        names in interface IArgs
        Returns:
        The set of all argument names in the argument list if this argument list is not indexed or null.
      • put

        public void put​(int index,
                        java.lang.Object value)
        Specified by:
        put in interface IArgs
      • put

        public void put​(java.lang.String name,
                        java.lang.Object value)
        Specified by:
        put in interface IArgs
      • size

        public int size()
        Description copied from interface: IArgs
        The total number of arguments.
        Specified by:
        size in interface IArgs
        Returns:
        The total number of arguments.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object