This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testMultiDigits() { | |
testResult("123", new Double(123)); | |
} | |
@Test | |
public void testFractionalDecimal() { | |
testResult("123.456", new Double(123.456)); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testFunctionWithRecursion() { | |
testResult( | |
"fakult(a) {" + | |
" if (a>1) {" + | |
" a * fakult(a-1)" + | |
" } else {" + | |
" 1" + | |
" }"+ | |
"}" + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testBooleanValues() { | |
testResult("true", true); | |
testResult("false", false); | |
testResult("x=true y=false x", true); | |
testResult("x=true y=false y", false); | |
} | |
@Test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void testResult(String string, Double expected) { | |
testResult(string, new Value(expected)); | |
} | |
public void testResult(String string, Boolean expected) { | |
testResult(string, new Value(expected), Type.BOOLEAN); | |
} | |
private final static String CLASS_NAME = "MyGeneratedClass"; | |
private static Integer classCounter = new Integer(1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Schema für parameter und rückgabewert-typen: | |
<TYPE>:<NAME> | |
Bsp: Parameter= double:a | |
Bsp: Funktion= boolean:equal(double:a double:b) {...} | |
Die Funktionen haben als Default double als Rückgabetyp, falls dieser nicht angegeben ist | |
*/ | |
@Test | |
public void testSimpleFunction() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testDigits() { | |
testResult("5", new Double(5)); | |
testResult("123", new Double(123)); | |
testResult("123.456", new Double(123.456)); | |
} | |
@Test | |
public void testBooleanValues() { | |
testResult("true", true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compiled from MyGeneratedClass1.java (version 1.1 : 45.3, super bit) | |
public class MyGeneratedClass1 { | |
// Method descriptor #8 ()V | |
// Stack: 1, Locals: 1 | |
public MyGeneratedClass1(); | |
0 aload_0 [this] | |
1 invokespecial java.lang.Object() [10] | |
4 return | |
Local variable table: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.event.MouseEvent; | |
import java.awt.event.MouseMotionListener; | |
import javax.swing.JFrame; | |
import com.panayotis.gnuplot.JavaPlot; | |
import com.panayotis.gnuplot.swing.JPlot; | |
// include JavaPlot.jar from this site to your classpath | |
// http://gnujavaplot.sourceforge.net/JavaPlot/About.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final EditingModalGraphMouse<Number,Number> graphMouse = | |
new EditingModalGraphMouse<Number,Number>(vv.getRenderContext(), vertexFactory, edgeFactory, 1,1); | |
graphMouse.setZoomAtMouse(false); | |
// the EditingGraphMouse will pass mouse event coordinates to the | |
// vertexLocations function to set the locations of the vertices as | |
// they are created | |
// graphMouse.setVertexLocations(vertexLocations); | |
vv.setGraphMouse(graphMouse); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Point3D { | |
public double x; | |
public double y; | |
public double z; | |
public Point3D(double xPos, double yPos, double zPos) { | |
this.x = xPos; | |
this.y = yPos; | |
this.z = zPos; | |
} |
OlderNewer