1 package net.jaekl.cfb.store;
3 import net.jaekl.cfb.xml.BugClass;
4 import net.jaekl.cfb.xml.BugMethod;
5 import net.jaekl.cfb.xml.SourceLine;
7 public class Location {
15 public Location(SourceLine sourceLine)
20 public Location(BugMethod method)
22 init(method.getSourceLines());
23 m_className = method.getClassName();
24 m_methodName = method.getMethodName();
25 m_methodRole = method.getRole();
28 public Location(BugMethod method, SourceLine sourceLine)
31 m_className = method.getClassName();
32 m_methodName = method.getMethodName();
33 m_methodRole = method.getRole();
36 public Location(BugClass bugClass)
38 init(bugClass.getSourceLines());
39 m_className = bugClass.getClassName();
42 public Location(Long id, String className, String methodName, String methodRole, long startLine, long endLine)
47 public String getClassName() { return m_className; }
48 public String getMethodName() { return m_methodName; }
49 public String getMethodRole() { return m_methodRole; }
50 public int getStart() { return m_startLine; }
51 public int getEnd() { return m_endLine; }
53 private void init(SourceLine[] sourceLines)
55 if (sourceLines.length > 0) {
56 assert(null != sourceLines[0]);
61 private void init(SourceLine sourceLine)
63 init(sourceLine.getClassName(), sourceLine.getStart(), sourceLine.getEnd());
66 private void init(String className, int startLine, int endLine)
69 m_className = className;
72 m_startLine = startLine;