Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Do Mrz 27 2008 21:46:26 CET
file stats: LOC: 100   Methods: 6
NCLOC: 31   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
SourcePosition.java - 70% 83,3% 75%
coverage coverage
 1    /* $Id: SourcePosition.java,v 1.3 2008/03/27 05:16:25 m31 Exp $
 2    *
 3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
 4    *
 5    * Copyright 2000-2008, Michael Meyling <mime@qedeq.org>.
 6    *
 7    * "Hilbert II" is free software; you can redistribute
 8    * it and/or modify it under the terms of the GNU General Public
 9    * License as published by the Free Software Foundation; either
 10    * version 2 of the License, or (at your option) any later version.
 11    *
 12    * This program is distributed in the hope that it will be useful,
 13    * but WITHOUT ANY WARRANTY; without even the implied warranty of
 14    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 15    * GNU General Public License for more details.
 16    */
 17   
 18    package org.qedeq.kernel.common;
 19   
 20    import java.io.Serializable;
 21    import java.net.URL;
 22   
 23   
 24    /**
 25    * Describes a file position.
 26    *
 27    * @version $Revision: 1.3 $
 28    * @author Michael Meyling
 29    */
 30    public final class SourcePosition implements Serializable {
 31   
 32    /** Address of input, for identifying source. */
 33    private final URL address;
 34   
 35    /** Line number, starting with 1. */
 36    private int line;
 37   
 38    /** Column number, starting with 1. */
 39    private int column;
 40   
 41    /**
 42    * Constructs source position object.
 43    *
 44    * @param address source address
 45    * @param line Line number.
 46    * @param column Column number.
 47    */
 48  68042 public SourcePosition(final URL address, final int line, final int column) {
 49  68042 this.address = address;
 50  68042 this.line = line;
 51  68042 this.column = column;
 52    }
 53   
 54    /**
 55    * Constructs file position object.
 56    *
 57    * @param address for identifying source
 58    * @param localAddress source address
 59    * @param line Line number.
 60    * @param column Column number.
 61    */
 62  0 public SourcePosition(final URL address, final URL localAddress,
 63    final int line, final int column) {
 64  0 this.address = address;
 65  0 this.line = line;
 66  0 this.column = column;
 67    }
 68   
 69    /**
 70    * Get address (or something to identify it) of input source.
 71    *
 72    * @return address of input source
 73    */
 74  14 public final URL getAddress() {
 75  14 return this.address;
 76    }
 77   
 78    /**
 79    * Get line number, starting with 1.
 80    *
 81    * @return Line number.
 82    */
 83  500 public final int getLine() {
 84  500 return line;
 85    }
 86   
 87    /**
 88    * Get column number, starting with 1.
 89    *
 90    * @return column number
 91    */
 92  319 public final int getColumn() {
 93  319 return column;
 94    }
 95   
 96  14 public final String toString() {
 97  14 return getAddress() + ":" + getLine() + ":" + getColumn();
 98    }
 99   
 100    }