Math2mat
|
00001 /****************************************************************************** 00002 * Negation 00003 ****************************************************************************** 00004 * Auteur : Trolliet Gregory 00005 * Date : 4 mars 2009 00006 * Description : 00007 ******************************************************************************/ 00008 00009 package m2m.backend.structure; 00010 00018 public class Negation extends Operation { 00019 00020 final static String OPNAME="neg"; 00021 00022 public Negation() { 00023 super(OPNAME); 00024 } 00025 00026 @Override 00027 public void copyTo(Element e,Function newFunc) { 00028 Negation newElement=(Negation)e; 00029 super.copyTo(newElement,newFunc); 00030 } 00031 00032 @Override 00033 public Element copy(Function newFunc) { 00034 Negation newElement=new Negation(); 00035 this.copyTo(newElement,newFunc); 00036 return newElement; 00037 } 00038 00039 @Override 00040 public String getOpSymbol() { 00041 return "-"; 00042 } 00043 00044 @Override 00045 public String toOctave(int level) { 00046 String sOctave = new String(); 00047 sOctave += tab(level) + this.output.firstElement().getName() + "\t= -" + this.input.firstElement().getName(); 00048 if (!monitor) { 00049 sOctave += ";"; 00050 } 00051 return sOctave; 00052 } 00053 00054 }