Package | Description |
---|---|
listFW | |
listFW.visitor | |
model |
Modifier and Type | Class and Description |
---|---|
class |
ToStringAlgo
Computes a String reprsentation of IList showing a left parenthesis followed
by elements of the IList separated by commas, ending with with a right parenthesis.
|
(package private) class |
ToStringHelper
Helps ToStringAlgo compute the String representation of the rest of the list.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
NEList.execute(IListAlgo algo,
java.lang.Object... inp)
Calls the nonEmptyCase method of the IListAlgo parameter, passing to this
method itself as the host parameter and the given input as the input
parameter.
|
java.lang.Object |
MTList.execute(IListAlgo algo,
java.lang.Object... inp)
Calls the empty case of the algorithm algo, passing to it itself as
the host parameter and the given input inp as the input parameter.
|
java.lang.Object |
IList.execute(IListAlgo algo,
java.lang.Object... inp)
Relegates to subclasses to call algo to perform the appropriate task with the given
input and returns an Object representing the output of the computation.
|
Modifier and Type | Class and Description |
---|---|
class |
AddToAlgo
Returns a copy of the list where the single integer parameter is added to all elements
|
class |
CopyAlgo
Returns a copy of the list
|
class |
CountAlgo
Returns the count of the number of elements in the list
|
class |
FoldLAlgo
Performs the fold-left (forward accumulation) algorithm using the given IAccumulator
The general forward accumulation algorithm would not take an accumulator as a top-level
input parameter, instead the accumulator would be hidden inside the algorithm.
|
class |
FoldRAlgo
Performs the fold-right (reverse accumulation) algorithm using the given IAccumulator.
|
class |
ProdAlgo |
class |
SumFwdAlgo
Returns the sum of a list of integers using forward accumulation.
|
class |
SumRevAlgo
Returns the sum of a list of integers using reverse accumulation.
|
Modifier and Type | Field and Description |
---|---|
private IListAlgo |
SumFwdAlgo.helper
Recursive helper that uses an accumulator as its input parameter.
|
private IListAlgo |
FoldLAlgo.helper
Helper visitor
Arguable, this visitor above is unnecessary, but idea here was
to stick to the general architecture of any forward accumulation
algorithm, which foldl represents.
|
Modifier and Type | Field and Description |
---|---|
private IListAlgo |
ListDemoModel.foldl |
private IListAlgo |
ListDemoModel.foldr |
Modifier and Type | Field and Description |
---|---|
private DynamicLoader<IListAlgo> |
ListDemoModel.visLoader |