Package de.intarsys.tools.functor
Class ChainedArgs
- java.lang.Object
-
- de.intarsys.tools.functor.ChainedArgs
-
-
Constructor Summary
Constructors Constructor Description ChainedArgs(IArgs args, IArgs fallbackArgs)Create newChainedArgswhereargsare always looked up first.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.Object object)voidclear()java.lang.Objectget(int index)The argument at positionindex.java.lang.Objectget(int index, java.lang.Object defaultValue)The argument at positionindexjava.lang.Objectget(java.lang.String name)The argument namedname.java.lang.Objectget(java.lang.String name, java.lang.Object defaultValue)The argument namednameor the defaultValue if not available.IArgsgetArgs()The main (primary)IArgs.IArgsgetFallbackArgs()The fallback (secondary)IArgs;booleanisDefined(int index)trueif an argument atindexis defined.booleanisDefined(java.lang.String name)trueif an argument namednameis defined.booleanisIndexed()trueif this argument list is indexed.booleanisNamed()trueif this argument list is named.java.util.Setnames()The set of all argument names in the argument list if this argument list is not indexed or null.voidput(int index, java.lang.Object value)voidput(java.lang.String name, java.lang.Object value)intsize()The total number of arguments.java.lang.StringtoString()
-
-
-
Constructor Detail
-
ChainedArgs
public ChainedArgs(IArgs args, IArgs fallbackArgs)
Create newChainedArgswhereargsare always looked up first. If lookup fails,fallbackArgsare used.
-
-
Method Detail
-
get
public java.lang.Object get(int index)
Description copied from interface:IArgsThe argument at positionindex.
-
get
public java.lang.Object get(int index, java.lang.Object defaultValue)Description copied from interface:IArgsThe argument at positionindex
-
get
public java.lang.Object get(java.lang.String name)
Description copied from interface:IArgsThe argument namedname.
-
get
public java.lang.Object get(java.lang.String name, java.lang.Object defaultValue)Description copied from interface:IArgsThe argument namednameor the defaultValue if not available.
-
getFallbackArgs
public IArgs getFallbackArgs()
The fallback (secondary)IArgs;- Returns:
- The fallback (secondary)
IArgs;
-
isDefined
public boolean isDefined(int index)
Description copied from interface:IArgstrueif an argument atindexis defined.
-
isDefined
public boolean isDefined(java.lang.String name)
Description copied from interface:IArgstrueif an argument namednameis defined.
-
isIndexed
public boolean isIndexed()
Description copied from interface:IArgstrueif 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.
-
isNamed
public boolean isNamed()
Description copied from interface:IArgstrueif 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.
-
names
public java.util.Set names()
Description copied from interface:IArgsThe set of all argument names in the argument list if this argument list is not indexed or null.
-
put
public void put(java.lang.String name, java.lang.Object value)
-
size
public int size()
Description copied from interface:IArgsThe total number of arguments.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-