Logo
Distributed Genetic Programming Framework
print print

File org.sfc.math.stochastic.statistics.ValueExtractor.java

Here you can find all the information about the file org.sfc.math.stochastic.statistics.ValueExtractor.java. You may explore it here or download it onto your local disk.
/*
 * Copyright (c) 2005 Thomas Weise
 *
 * E-Mail           : tweise@gmx.de
 * Creation Date    : 2005-12-21 09:14:03
 * Original Filename: org.sfc.math.stochastic.statistics.ValueExtractor.java
 * Version          : 3.0.0
 * Last modification: 2006-04-10
 *                by: Thomas Weise
 *
 * License          : GNU LESSER GENERAL PUBLIC LICENSE
 *                    Version 2.1, February 1999
 *                    You should have received a copy of this license along
 *                    with this library; if not, write to the Free Software
 *                    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *                    MA 02111-1307, USA or download the license under
 *                    http://www.gnu.org/copyleft/lesser.html.
 *
 * Warranty         : This software is provided "as is" without any
 *                    warranty; without even the implied warranty of
 *                    merchantability or fitness for a particular purpose.
 *                    See the Gnu Lesser General Public License for more
 *                    details.
 */


package org.sfc.math.stochastic.statistics;

/**
 * With this class, you may obtain <code>double</code>-precision floating
 * point values from objects that represent direct/random accessible
 * sequences, such as arrays.
 *
 * @param <CollectionType>  The type of objects handled by this value getter.
 *                          This will normally be an array type or such and
 *                          such.
 * @author Thomas Weise
 */

public abstract class ValueExtractor<CollectionType>
  {
/**
 * The singleton instance for arrays of <code>double</code>.
 */

  public static final ValueExtractor<double[]> DOUBLE_ARRAY_INSTANCE =
      new ValueExtractor<double[]>()
        {
        @Override
        protected final double  get_value(final double[] p_collection,
                                          final int      p_index)
          {
          return p_collection[p_index];
          }
        };
//
///**
// * The singleton instance for arrays of <code>int</code>.
// */

//  public static final ValueExtractor<int[]> INT_ARRAY_INSTANCE =
//      new ValueExtractor<int[]>()
//        {
//        @Override
//        protected final double  get_value(final int[]    p_collection,
//                                          final int      p_index)
//          {
//          return p_collection[p_index];
//          }
//        };
//
//
///**
// * The singleton instance for arrays of <code>long</code>.
// */

//  public static final ValueExtractor<long[]> LONG_ARRAY_INSTANCE =
//      new ValueExtractor<long[]>()
//        {
//        @Override
//        protected final double  get_value(final long[]    p_collection,
//                                          final int       p_index)
//          {
//          return p_collection[p_index];
//          }
//        };
//
//
///**
// * The singleton instance for arrays of <code>float</code>.
// */

//  public static final ValueExtractor<float[]> FLOAT_ARRAY_INSTANCE =
//      new ValueExtractor<float[]>()
//        {
//        @Override
//        protected final double  get_value(final float[]   p_collection,
//                                          final int       p_index)
//          {
//          return p_collection[p_index];
//          }
//        };

/**
 * Obtain a double value from the item at position <code>p_index</code> in
 * the collection.
 * @param p_collection  The collection object to obtain the value from.
 * @param p_index       The index of the item to return the value of.
 * @return              The <code>double</code> representation of the item
 *                      at this position.
 */

  protected abstract  double  get_value(final CollectionType p_collection,
                                        final int            p_index);
  }

File Information:

file name:ValueExtractor.java
package:org.sfc.math.stochastic.statistics
qualified name:org.sfc.math.stochastic.statistics.ValueExtractor.java
file type:Java Source File
download location:download http://dgpf.sourceforge.net/source/org/sfc/math/stochastic/statistics/ValueExtractor.java
size:3.852 KB (3945 B)
uploaded: 2015-07-22 04:11:12 GMT+0000
last update: 2006-04-10 10:13:07 GMT+0000
last access: 2018-01-20 18:30:08 GMT+0000

statistics online since 2006-01-02.   RSS Feed
Contact us by sending an email to tweise@gmx.de to receive further information, to report errors, or to join our project.
All content on this site (http://dgpf.sourceforge.net/) is LGPL-licensed.
http://dgpf.sourceforge.net/scripts/source/source.php last modified at 2015-07-22 04:10:53 GMT+0000 served at 2018-01-20 18:30:08 GMT+0000.
Valid CSS Valid XHTML 1.1
Valid RSS SourceForge.net Logo