|
Orbital library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object orbital.logic.functor.MutableFunction.TableFunction
public static class MutableFunction.TableFunction
A mutable function implemented as a tabular HashMap.
HashMap
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface orbital.logic.functor.MutableFunction |
---|
MutableFunction.TableFunction |
Nested classes/interfaces inherited from interface orbital.logic.functor.Function |
---|
Function.Composite |
Nested classes/interfaces inherited from interface orbital.logic.functor.Functor |
---|
Functor.Specification |
Field Summary |
---|
Fields inherited from interface orbital.logic.functor.Function |
---|
callTypeDeclaration |
Constructor Summary | |
---|---|
MutableFunction.TableFunction()
Create a table-based mutable function without lazy initialization. |
|
MutableFunction.TableFunction(Function initialization)
|
|
MutableFunction.TableFunction(Function initialization,
boolean cache)
Create a table-based mutable function. |
|
MutableFunction.TableFunction(java.util.Map map,
Function initialization,
boolean cache)
Create a preinitialized table-based mutable function. |
Method Summary | |
---|---|
java.lang.Object |
apply(java.lang.Object arg)
Get the value of an argument. |
java.lang.Object |
clone()
|
Function |
getInitialization()
Get the initialization function h. |
java.lang.Object |
set(java.lang.Object arg,
java.lang.Object value)
Update the value at an argument. |
void |
setInitialization(Function initialization)
Set the initialization function h to use. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface orbital.logic.functor.Functor |
---|
equals, hashCode, toString |
Constructor Detail |
---|
public MutableFunction.TableFunction(java.util.Map map, Function initialization, boolean cache)
map
- The tabular map in which values are stored.initialization
- The function h to use for implicit lazy initialization f(x) = h(x)
for yet unknown arguments x.
Use null
to disable lazy initialization,
leading to null
being the value for yet unknown arguments.cache
- whether values lazy initialized via initialization
should
be cached in the hash map.
Caching is important when no memory constraints are posed and the initialization
function performs expensive calculation.public MutableFunction.TableFunction(Function initialization, boolean cache)
initialization
- The function h to use for implicit lazy initialization f(x) = h(x)
for yet unknown arguments x.
Use null
to disable lazy initialization,
leading to null
being the value for yet unknown arguments.cache
- whether values lazy initialized via initialization
should
be cached in the hash map.
Caching is important when no memory constraints are posed and the initialization
function performs expensive calculation.public MutableFunction.TableFunction(Function initialization)
public MutableFunction.TableFunction()
Method Detail |
---|
public java.lang.Object clone()
clone
in interface MutableFunction
clone
in class java.lang.Object
public Function getInitialization()
public void setInitialization(Function initialization)
initialization
- The function h to use for implicit lazy initialization f(x) = h(x)
for yet unknown arguments x, from now on.
Use null
to disable lazy initialization,
leading to null
being the value for yet unknown arguments.public java.lang.Object apply(java.lang.Object arg)
apply
in interface Function
arg
- generic Object as argument
public java.lang.Object set(java.lang.Object arg, java.lang.Object value)
set
in interface MutableFunction
arg
- the argument x whose cost to update.value
- the new value f(x) to set for argument x.
|
Orbital library 1.3.0: 11 Apr 2009 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |