KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgap > gp > terminal > NOP


1 /*
2  * This file is part of JGAP.
3  *
4  * JGAP offers a dual license model containing the LGPL as well as the MPL.
5  *
6  * For licencing information please see the file license.txt included with JGAP
7  * or have a look at the top of class org.jgap.Chromosome which representatively
8  * includes the JGAP license policy applicable for any file delivered with JGAP.
9  */

10 package org.jgap.gp.terminal;
11
12 import org.jgap.*;
13 import org.jgap.gp.*;
14 import org.jgap.gp.impl.*;
15
16 /**
17  * NO Operation. Does exactly nothing. Useful when a terminal with return type
18  * void is needed.
19  *
20  * @author Klaus Meffert
21  * @since 3.0
22  */

23 public class NOP
24     extends MathCommand {
25   /** String containing the CVS revision. Read out via reflection!*/
26   private final static String JavaDoc CVS_REVISION = "$Revision: 1.6 $";
27
28   public NOP(final GPConfiguration a_conf)
29       throws InvalidConfigurationException {
30     this(a_conf, 0);
31   }
32
33   public NOP(final GPConfiguration a_conf, int a_subReturnType)
34       throws InvalidConfigurationException {
35     super(a_conf, 0, CommandGene.VoidClass, a_subReturnType, null);
36   }
37
38   public String JavaDoc toString() {
39     return "NOP";
40   }
41
42   /**
43    * @return textual name of this command
44    *
45    * @author Klaus Meffert
46    * @since 3.2
47    */

48   public String JavaDoc getName() {
49     return "NOP (NO Operation)";
50   }
51
52   public void execute_void(ProgramChromosome c, int n, Object JavaDoc[] args) {
53     // Do nothing here as it is NOP.
54
// ----------------------------
55
;
56   }
57 }
58
Popular Tags