net.sf.latexdraw.parsers.ps
Class PSFunctionParser
java.lang.Object
net.sf.latexdraw.parsers.ps.PSFunctionParser
public class PSFunctionParser
- extends java.lang.Object
Defines a postscript function parser.
This file is part of LaTeXDraw
Copyright (c) 2005-2012 Arnaud BLOUIN
LaTeXDraw is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
LaTeXDraw is distributed without any warranty; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.
03/11/08
- Version:
- 3.0
- Author:
- Arnaud BLOUIN
Constructor Summary |
PSFunctionParser(java.lang.String fct)
Creates and parser from postscript functions. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
function
protected java.lang.String function
- The postscript function.
commands
protected java.util.List<PSArithemticCommand> commands
CMD_MUL
public static final java.lang.String CMD_MUL
- See Also:
- Constant Field Values
CMD_ADD
public static final java.lang.String CMD_ADD
- See Also:
- Constant Field Values
CMD_SUB
public static final java.lang.String CMD_SUB
- See Also:
- Constant Field Values
CMD_SIN
public static final java.lang.String CMD_SIN
- See Also:
- Constant Field Values
CMD_COS
public static final java.lang.String CMD_COS
- See Also:
- Constant Field Values
CMD_DIV
public static final java.lang.String CMD_DIV
- See Also:
- Constant Field Values
CMD_IDIV
public static final java.lang.String CMD_IDIV
- See Also:
- Constant Field Values
CMD_MOD
public static final java.lang.String CMD_MOD
- See Also:
- Constant Field Values
CMD_NEG
public static final java.lang.String CMD_NEG
- See Also:
- Constant Field Values
CMD_EXCH
public static final java.lang.String CMD_EXCH
- See Also:
- Constant Field Values
CMD_CLEAR
public static final java.lang.String CMD_CLEAR
- See Also:
- Constant Field Values
CMD_DUP
public static final java.lang.String CMD_DUP
- See Also:
- Constant Field Values
CMD_POP
public static final java.lang.String CMD_POP
- See Also:
- Constant Field Values
CMD_ROLL
public static final java.lang.String CMD_ROLL
- See Also:
- Constant Field Values
CMD_SQRT
public static final java.lang.String CMD_SQRT
- See Also:
- Constant Field Values
CMD_EXP
public static final java.lang.String CMD_EXP
- See Also:
- Constant Field Values
CMD_ABS
public static final java.lang.String CMD_ABS
- See Also:
- Constant Field Values
CMD_FLOOR
public static final java.lang.String CMD_FLOOR
- See Also:
- Constant Field Values
CMD_CEILING
public static final java.lang.String CMD_CEILING
- See Also:
- Constant Field Values
CMD_COUNT
public static final java.lang.String CMD_COUNT
- See Also:
- Constant Field Values
CMD_X
public static final java.lang.String CMD_X
- See Also:
- Constant Field Values
PSFunctionParser
public PSFunctionParser(java.lang.String fct)
throws InvalidFormatPSFunctionException
- Creates and parser from postscript functions.
- Parameters:
fct
- The function to parse.
- Throws:
InvalidFormatPSFunctionException
- If the function format is not valid.- Since:
- 3.0
getY
public double getY(double x)
throws InvalidFormatPSFunctionException
- Parameters:
x
- The X-coordinate used to computre the Y using the function.
- Returns:
- The y value corresponding to the given X value.
- Throws:
InvalidFormatPSFunctionException
- If the function is not correct.
parseFunction
public void parseFunction()
throws InvalidFormatPSFunctionException
- Parses the function.
- Throws:
InvalidFormatPSFunctionException
- If the function is not correct.
identifyCommand
public PSArithemticCommand identifyCommand(java.lang.String cmd)
throws InvalidFormatPSFunctionException
- Parameters:
cmd
- The arithmetic command to analyse.
- Returns:
- The arithmetic instance corresponding to the given command.
- Throws:
InvalidFormatPSFunctionException
- If the function is not correct.- Since:
- 3.0