public final class RunSortBuilder extends Object
This class is used for running sorting algorithms. You can construct an instance using the
GroovyLocals.run(SortInfo)
method, and other run
methods.
This class is configured using a map of options. This map can contain a strict set of keys Here is the list of allowed keys and their types:
numbers
(Integer
) — The number of values to sortbuckets
(Integer
) — An extra value to pass to the sorting
algorithmspeed
(Number
) — The time multiplier of the visualMap.Entry
values to put into the option map can be obtained using RunSortInfoExtension
.
GroovyLocals.run(SortInfo)
,
RunSortInfoExtension
Modifier and Type | Method and Description |
---|---|
int |
getBuckets()
The extra value to pass to the sort (key of
"buckets" ) |
int |
getLength()
The configured length of the array (key of
"numbers" ) |
Map<String,Object> |
getOpts()
The options configured for this builder
|
SortInfo |
getSort()
The sorting algorithm this builder will run
|
double |
getSpeed()
The speed multiplier of the visual (key of
"speed" ) |
RunSortBuilder |
go(Map.Entry<String,Object>... opts)
Merge the specified options with the options map, and run the sort
|
RunSortBuilder |
go(Map<String,Object> opts)
Merge the specified options with the options map, and run the sort
|
String |
toString() |
RunSortBuilder |
with(Map.Entry<String,Object>... opts)
Merge the specified options with the options map
|
RunSortBuilder |
with(Map<String,Object> opts)
Merge the specified options with the options map
|
public SortInfo getSort()
SortInfo
public Map<String,Object> getOpts()
public RunSortBuilder with(Map<String,Object> opts)
opts
- The options to merge, generally using Groovy's named argument syntaxthis
for chainingRunSortInfoExtension
@SafeVarargs public final RunSortBuilder with(Map.Entry<String,Object>... opts)
opts
- The options to merge, generally obtained with RunSortInfoExtension
this
for chainingRunSortInfoExtension
public RunSortBuilder go(Map<String,Object> opts)
opts
- The options to merge, generally using Groovy's named argument syntaxRunSortInfoExtension
@SafeVarargs public final RunSortBuilder go(Map.Entry<String,Object>... opts)
opts
- The options to merge, generally obtained with RunSortInfoExtension
RunSortInfoExtension
public int getLength()
"numbers"
)RunSortInfoExtension.getNumbers(java.lang.Integer)
public int getBuckets()
"buckets"
)RunSortInfoExtension.getBuckets(java.lang.Integer)
public double getSpeed()
"speed"
)RunSortInfoExtension.getSpeed(java.lang.Number)
Copyright © 2024. All rights reserved.