IgnoreCommandException.java :  » Graphic-Library » LaTeXDraw-2.0.8 » latexDraw » parsers » Java Open Source

Java Open Source » Graphic Library » LaTeXDraw 2.0.8 
LaTeXDraw 2.0.8 » latexDraw » parsers » IgnoreCommandException.java
package latexDraw.parsers;

/** 
 * This kind of exception occurs when you want to ignore a command.
 * 
 * This file is part of LaTeXDraw<br>
 * Copyright (c) 2005-2008 Arnaud BLOUIN<br>
 *<br>
 *  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.<br>
 *<br>
 *  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.<br>
 * <br>
 * 02/01/06<br>
 * @author Arnaud BLOUIN<br>
 * @version 2.0.0<br>
 */
public class IgnoreCommandException extends Exception
{
  private static final long serialVersionUID = 1L;

  /** The ignored command. */
  String command;
  
  /** The number of the line where the command is. */
  int nLine;
  
  
  /**
   * The constructor using the number of the line of the ignored command.
   * @param nl The number of line of the ignored command.
   */
  public IgnoreCommandException(int nl)
  { 
    command = "";//$NON-NLS-1$
    nLine = nl;
  }
  
  
  /**
   * The constructor using the name of the ignored command.
   * @param cmd The name of the ignored command.
   * @param nl The number of line of the ignored command.
   */
  public IgnoreCommandException(String cmd, int nl)
  { 
    command = cmd;
    nLine = nl;
  }
  
  
  
  @Override
  public String toString()
  {
    if(command==null || command.length()==0)
      return "Line "+ nLine + " : a command has been ignored!"; //$NON-NLS-1$ //$NON-NLS-2$
    return "Line "+ nLine + " : the command "+command+" has been ignored!";//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
  }
  
  
  
  /**
   * @return the command
   */
  public String getCommand()
  {
    return command;
  }



  /**
   * @return the nLine
   */
  public int getNLine()
  {
    return nLine;
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.