|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.intarsys.tools.functor.DeclaredArgs
public class DeclaredArgs
This IArgs implementation allows the declaration of arguments.
The declaration is matched against the actual arguments defined in
args. The declaration defines a mapping from indexed to named
and AND vice versa.
If we have indexed args, a declaration associates a name with the argument in the sequence of declaration.
If we have named args, a declaration defines the index of the argument with the same name.
| Field Summary |
|---|
| Fields inherited from interface de.intarsys.tools.functor.IArgs |
|---|
ARG_ARGS |
| Constructor Summary | |
|---|---|
protected |
DeclaredArgs(IArgs args)
|
| Method Summary | |
|---|---|
void |
add(java.lang.Object object)
|
void |
clear()
|
static DeclaredArgs |
createStrict(IArgs args)
|
static DeclaredArgs |
createStrictIfDeclared(IArgs args)
|
static DeclaredArgs |
createTransparent(IArgs args)
|
protected void |
declare(IFunctorCall call,
ArgumentDeclaration argDecl)
|
protected void |
declare(IFunctorCall call,
java.lang.String name,
int index,
IFunctor defaultFunctor)
|
java.lang.Object |
get(int pIndex)
The argument at position index. |
java.lang.Object |
get(int pIndex,
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. |
IArgs |
getArgsIn()
|
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. |
protected boolean |
isLazy()
|
boolean |
isNamed()
true if this argument list is named. |
protected boolean |
isStrict()
|
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)
|
protected void |
setLazy(boolean lazy)
|
protected void |
setStrict(boolean strict)
|
int |
size()
The total number of arguments. |
protected void |
switchArgs()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected DeclaredArgs(IArgs args)
| Method Detail |
|---|
public static DeclaredArgs createStrict(IArgs args)
public static DeclaredArgs createStrictIfDeclared(IArgs args)
public static DeclaredArgs createTransparent(IArgs args)
public void add(java.lang.Object object)
add in interface IArgspublic void clear()
clear in interface IArgs
protected void declare(IFunctorCall call,
ArgumentDeclaration argDecl)
throws DeclarationException
DeclarationException
protected void declare(IFunctorCall call,
java.lang.String name,
int index,
IFunctor defaultFunctor)
throws DeclarationException
DeclarationExceptionpublic java.lang.Object get(int pIndex)
IArgsindex.
get in interface IArgspIndex - The index of the argument to return.
index.
public java.lang.Object get(int pIndex,
java.lang.Object defaultValue)
IArgsindex
get in interface IArgspIndex - The index of the argument to return.defaultValue - The default value to be returned if argument is not available.
indexpublic java.lang.Object get(java.lang.String name)
IArgsname.
get in interface IArgsname - The name of the argument to return.
name .
public java.lang.Object get(java.lang.String name,
java.lang.Object defaultValue)
IArgsname or the defaultValue if not
available.
get in interface IArgsname - The name of the argument to return.defaultValue - The default value to be returned if argument is not available.
namepublic IArgs getArgsIn()
public boolean isDefined(int index)
IArgstrue if an argument at index is defined.
isDefined in interface IArgstrue if an argument at index is
defined.public boolean isDefined(java.lang.String name)
IArgstrue if an argument named name is defined.
isDefined in interface IArgstrue if an argument named name is
defined.public boolean isIndexed()
IArgstrue 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 IArgstrue if this argument list is indexed.protected boolean isLazy()
public boolean isNamed()
IArgstrue 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 IArgstrue if this argument list is named.protected boolean isStrict()
public java.util.Set names()
IArgs
names in interface IArgs
public void put(int index,
java.lang.Object value)
put in interface IArgs
public void put(java.lang.String name,
java.lang.Object value)
put in interface IArgsprotected void setLazy(boolean lazy)
protected void setStrict(boolean strict)
public int size()
IArgs
size in interface IArgsprotected void switchArgs()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||