PageRenderTime 43ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/bundles/plugins-trunk/RubyPlugin/src/org/jedit/ruby/ast/Problem.java

#
Java | 61 lines | 24 code | 10 blank | 27 comment | 0 complexity | 3d05f8965ae3b93b4320dba5fd6a58a7 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  1. /*
  2. * Problem.java -
  3. *
  4. * Copyright 2005 Robert McKinnon
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version 2
  9. * of the License, or any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19. */
  20. package org.jedit.ruby.ast;
  21. import org.jedit.ruby.RubyPlugin;
  22. /**
  23. * @author robmckinnon at users.sourceforge.net
  24. */
  25. public abstract class Problem extends Member {
  26. private final int line;
  27. /**
  28. * @param message warning message
  29. * @param line line number starting at 0
  30. */
  31. Problem(String message, int line) {
  32. super(message);
  33. this.line = line;
  34. }
  35. public final String getName() {
  36. return " " + (line + 1) + ": " + super.getName();
  37. }
  38. public final String getFullName() {
  39. return getName();
  40. }
  41. public final String getShortName() {
  42. return super.getName();
  43. }
  44. public final int getStartOffset() {
  45. return RubyPlugin.getNonSpaceStartOffset(line);
  46. }
  47. /** don't like using jEdit View here */
  48. public final int getEndOffset() {
  49. return RubyPlugin.getEndOffset(line);
  50. }
  51. }