PageRenderTime 37ms CodeModel.GetById 33ms app.highlight 1ms RepoModel.GetById 2ms 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
 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 */
20package org.jedit.ruby.ast;
21
22import org.jedit.ruby.RubyPlugin;
23
24/**
25 * @author robmckinnon at users.sourceforge.net
26 */
27public abstract class Problem extends Member {
28
29    private final int line;
30
31    /**
32     * @param message warning message
33     * @param line line number starting at 0
34     */
35    Problem(String message, int line) {
36        super(message);
37        this.line = line;
38    }
39
40    public final String getName() {
41        return " " + (line + 1) + ": " + super.getName();
42    }
43
44    public final String getFullName() {
45        return getName();
46    }
47
48    public final String getShortName() {
49        return super.getName();
50    }
51
52    public final int getStartOffset() {
53        return RubyPlugin.getNonSpaceStartOffset(line);
54    }
55
56    /** don't like using jEdit View here */
57    public final int getEndOffset() {
58        return RubyPlugin.getEndOffset(line);
59    }
60
61}