|
Algorithm Development Kit 1.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectalgs.model.data.Generator<ILineSegment>
algs.model.data.segments.LoadFromFileGenerator
public class LoadFromFileGenerator
Generator of ILineSegment objects that loads requested points from a designated file (rather then through some computation).
Tries to honor the 'size' parameter when generating. That is, if there are more points in the file than 'size' it will be truncated. However if the file contains fewer points, the returned array will be smaller than requested.
Format of file: Individual lines with space-separated doubles (four of them)
Constructor Summary | |
---|---|
LoadFromFileGenerator(java.lang.String s)
|
Method Summary | |
---|---|
Generator<ILineSegment> |
construct(java.lang.String[] args)
Provide reflective behavior to construct instance of generator given an array of string arguments. |
ILineSegment[] |
generate(int size)
Generate a set of elements according to specialized criteria defined by the subclass. |
java.lang.String[] |
parameters()
Declares the name of the parameters used when constructing the generator in order from left to right. |
Methods inherited from class algs.model.data.Generator |
---|
toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LoadFromFileGenerator(java.lang.String s)
Method Detail |
---|
public java.lang.String[] parameters()
Generator
parameters
in class Generator<ILineSegment>
public Generator<ILineSegment> construct(java.lang.String[] args)
construct
in class Generator<ILineSegment>
public ILineSegment[] generate(int size)
Generator
There is no guarantee that the elements are unique.
generate
in class Generator<ILineSegment>
size
- The number of elements to be created.
|
Algorithm Development Kit 1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |