• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *****************************************************************************
3  * Copyright (C) 2000-2004, International Business Machines Corporation and  *
4  * others. All Rights Reserved.                                              *
5  *****************************************************************************
6  */
7 package com.ibm.rbm;
8 
9 /**
10  * This is a class used by the RBReporter to track occurances of a resource
11  * key found while scanning a text code file. It is used mainly to produce error
12  * messages with helpful context information.
13  *
14  * @author Jared Jackson
15  * @see com.ibm.rbm.RBReporter
16  */
17 public class Occurance {
18     private String file_name;
19     private String file_path;
20     private int line_number;
21 
22     /**
23      * Basic data constructor.
24      */
25 
Occurance(String file_name, String file_path, int line_number)26     Occurance (String file_name, String file_path, int line_number) {
27         this.file_name = file_name;
28         this.file_path = file_path;
29         this.line_number = line_number;
30     }
31 
32     /**
33      * Returns the associated file name of the occurance
34      */
35 
getFileName()36     public String getFileName() {
37         return file_name;
38     }
39 
40     /**
41      * Returns the associated file path of the occurance
42      */
43 
getFilePath()44     public String getFilePath() {
45         return file_path;
46     }
47 
48     /**
49      * Returns the line number of the occurance.
50      */
51 
getLineNumber()52     public int getLineNumber() {
53         return line_number;
54     }
55 
56     /**
57      * A representation of the occurance of the form 'Occurance: _file_path_ (_line_number_)'
58      */
59 
toString()60     public String toString() {
61         return "Occurance: " + file_path + " (" + line_number + ")";
62     }
63 }