View Javadoc

1    /***
2    * @(#)  MirkESystemException.java
3    *
4    * Created by:abuayyub on 14 Febuary, 2005.
5   
6   Copyright (c) 2004 Arizona State University - Cancer Research Institute. All rights reserved.
7   
8   MirkE is free software; you can redistribute it and/or modify
9   it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12  
13  MirkE is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  GNU General Public License for more details.
17  
18  You should have received a copy of the GNU General Public License
19  along with MirkE; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  US
21  package edu.asu.cri.MirkE.exceptions;
22  */
23   package> edu.asu.cri.MirkE.exceptions;
24  /***
25   * @author abuayyub
26   *
27   * TODO To change the template for this generated type comment go to
28   * Window - Preferences - Java - Code Style - Code Templates
29   */
30  
31      public class MirkESystemException extends Throwable{
32          
33          String _msg = "";
34          boolean exitIndicator = false;
35          /***
36           * Constructor with a message of the exception
37           *
38           * @param msg Message to further explain the exception
39           **/
40          public MirkESystemException ( String msg )
41          {
42             super( msg );
43          }
44  
45          /***
46           * Constructor with a message of the exception
47           *
48           * @param msg Message to further explain the exception
49           *  @param Throwable obj root cause of exception
50           **/
51          public  MirkESystemException (  String msg, Throwable obj )
52          {
53             super( msg, obj);
54          }
55  
56          /***
57           * Constructor with a message of the exception
58           *
59           * @param Throwable obj root cause of exception
60           **/
61          public MirkESystemException( Throwable obj )
62          {
63             super( obj);
64          }
65          
66          
67          /***
68           * Constructor with a message of the exception and indicator to tell the 
69           * exception handler to call system exit
70           *
71           * @param Throwable obj root cause of exception
72           * @param boolean system exit indicator
73           **/
74          public MirkESystemException(Throwable obj, boolean flag )
75          {
76             super( obj);
77          }
78  
79          
80          /***
81           * Constructor with a message of the exception and indicator to tell the 
82           * exception handler to call system exit
83           *
84           * @param Throwable obj root cause of exception
85           * @param boolean system exit indicator
86           **/
87          public MirkESystemException( boolean flag )
88          {
89             super( );
90             this.exitIndicator = flag;
91          }
92  
93          // -------------------------------------------------------------------------
94          // Methods
95          // -------------------------------------------------------------------------
96  
97          /***
98           * Describes the instance and its content for debugging purpose
99           *
100          * @return Using the one from the super class
101          **/
102         public String toString()
103         {
104            return super.toString();
105         }
106 
107         /***
108          * Determines if the given instance is the same as this instance
109          * based on its content. This means that it has to be of the same
110          * class ( or subclass ) and it has to have the same content
111          *
112          * @return Returns the equals value from the super class
113          **/
114         public boolean equals( Object obj )
115         {
116            return super.equals( obj );
117         }
118 
119         /***
120          * Returns the hashcode of this instance
121          *
122          * @return Hashcode of the super class
123          **/
124         public int hashCode()
125         {
126            return super.hashCode();
127         }
128         
129         public void setMyMessage(String msg){
130             if(_msg != ""){_msg = msg;}
131             else{_msg=_msg+" "+msg;}
132             
133         }
134         public String getMyMessage(){
135            return  super.getMessage()+" " +_msg;
136             
137         }
138         
139         
140     }
141