Algorithm
Development Kit 1.0

algs.model.data.nd
Class ConvertToND

java.lang.Object
  extended by algs.model.data.Generator<IMultiPoint>
      extended by algs.model.data.nd.ConvertToND

public class ConvertToND
extends Generator<IMultiPoint>

Wrapper generator that converts IPoint arrays into IMultiPoint object arrays.

Useful to enable IPoint generators to be reused for KD tree examples.

Since:
1.0
Version:
1.0, 6/15/08
Author:
George Heineman

Constructor Summary
ConvertToND(Generator<IPoint> pointGen)
           
 
Method Summary
 Generator<IMultiPoint> construct(java.lang.String[] args)
          Provide reflective behavior to construct instance of generator given an array of string arguments.
static IMultiPoint[] convert(IPoint[] pts)
          Utility function to construct an IMultiPoint[] array from an IPoint[] array.
 IMultiPoint[] generate(int size)
          Invoke inner generator and convert all to IMultiPoint.
 java.lang.String[] parameters()
          Parameters for wrappeer are derived from inner generator.
 
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

ConvertToND

public ConvertToND(Generator<IPoint> pointGen)
Method Detail

parameters

public java.lang.String[] parameters()
Parameters for wrappeer are derived from inner generator.

Specified by:
parameters in class Generator<IMultiPoint>

construct

public Generator<IMultiPoint> construct(java.lang.String[] args)
Provide reflective behavior to construct instance of generator given an array of string arguments.

Specified by:
construct in class Generator<IMultiPoint>

convert

public static IMultiPoint[] convert(IPoint[] pts)
Utility function to construct an IMultiPoint[] array from an IPoint[] array.

Parameters:
pts -

generate

public IMultiPoint[] generate(int size)
Invoke inner generator and convert all to IMultiPoint.

Specified by:
generate in class Generator<IMultiPoint>
Parameters:
size - The number of elements to be created.

Algorithm Development Kit 1.0

This code supports the Algorithms in a Nutshell book, published by O'Reilly Media, Inc. in November 2008. Please visit the book web page to learn of any changes to the code repository or to record a potential defect.