|
intarsys runtime library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.intarsys.tools.functor.ChainedArgs
public class ChainedArgs
An IArgs
implementation allowing to concat two IArgs
together. Lookup will be performed in "args" first. If nothing is found,
lookup is done in "fallbackArgs".
Field Summary |
---|
Fields inherited from interface de.intarsys.tools.functor.IArgs |
---|
ARG_ARGS |
Constructor Summary | |
---|---|
ChainedArgs(IArgs args,
IArgs fallbackArgs)
Create new ChainedArgs where args are always
looked up first. |
Method Summary | |
---|---|
void |
add(Object object)
|
void |
clear()
|
Object |
get(int index)
The argument at position index . |
Object |
get(int index,
Object defaultValue)
The argument at position index |
Object |
get(String name)
The argument named name . |
Object |
get(String name,
Object defaultValue)
The argument named name or the defaultValue if not
available. |
IArgs |
getArgs()
The main (primary) IArgs . |
IArgs |
getFallbackArgs()
The fallback (secondary) IArgs ; |
boolean |
isDefined(int index)
true if an argument at index is defined. |
boolean |
isDefined(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. |
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,
Object value)
|
void |
put(String name,
Object value)
|
int |
size()
The total number of arguments. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ChainedArgs(IArgs args, IArgs fallbackArgs)
ChainedArgs
where args
are always
looked up first. If lookup fails, fallbackArgs
are used.
args
- The main IArgs
to use for lookupfallbackArgs
- The fallback IArgs
for lookupMethod Detail |
---|
public void add(Object object)
add
in interface IArgs
public void clear()
clear
in interface IArgs
public Object get(int index)
IArgs
index
.
get
in interface IArgs
index
- The index of the argument to return.
index
.public Object get(int index, Object defaultValue)
IArgs
index
get
in interface IArgs
index
- The index of the argument to return.defaultValue
- The default value to be returned if argument is not available.
index
public Object get(String name)
IArgs
name
.
get
in interface IArgs
name
- The name of the argument to return.
name
.public Object get(String name, Object defaultValue)
IArgs
name
or the defaultValue if not
available.
get
in interface IArgs
name
- The name of the argument to return.defaultValue
- The default value to be returned if argument is not available.
name
public IArgs getArgs()
IArgs
.
IArgs
.public IArgs getFallbackArgs()
IArgs
;
IArgs
;public boolean isDefined(int index)
IArgs
true
if an argument at index
is defined.
isDefined
in interface IArgs
true
if an argument at index
is
defined.public boolean isDefined(String name)
IArgs
true
if an argument named name
is defined.
isDefined
in interface IArgs
true
if an argument named name
is
defined.public boolean isIndexed()
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.
isIndexed
in interface IArgs
true
if this argument list is indexed.public boolean isNamed()
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.
isNamed
in interface IArgs
true
if this argument list is named.public Set names()
IArgs
names
in interface IArgs
public void put(int index, Object value)
put
in interface IArgs
public void put(String name, Object value)
put
in interface IArgs
public int size()
IArgs
size
in interface IArgs
public String toString()
toString
in class Object
|
intarsys runtime library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |