Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
lDEVinux
GitHub Repository: lDEVinux/eaglercraft
Path: blob/main/src/lwjgl/java/paulscode/sound/SoundSystemException.java
8644 views
1
package paulscode.sound;
2
3
/**
4
* The SoundSystemException class is used to provide information about serious
5
* errors.
6
*<br><br>
7
*<b><i> SoundSystem License:</b></i><br><b><br>
8
* You are free to use this library for any purpose, commercial or otherwise.
9
* You may modify this library or source code, and distribute it any way you
10
* like, provided the following conditions are met:
11
*<br>
12
* 1) You may not falsely claim to be the author of this library or any
13
* unmodified portion of it.
14
*<br>
15
* 2) You may not copyright this library or a modified version of it and then
16
* sue me for copyright infringement.
17
*<br>
18
* 3) If you modify the source code, you must clearly document the changes
19
* made before redistributing the modified source code, so other users know
20
* it is not the original code.
21
*<br>
22
* 4) You are not required to give me credit for this library in any derived
23
* work, but if you do, you must also mention my website:
24
* http://www.paulscode.com
25
*<br>
26
* 5) I the author will not be responsible for any damages (physical,
27
* financial, or otherwise) caused by the use if this library or any part
28
* of it.
29
*<br>
30
* 6) I the author do not guarantee, warrant, or make any representations,
31
* either expressed or implied, regarding the use of this library or any
32
* part of it.
33
* <br><br>
34
* Author: Paul Lamb
35
* <br>
36
* http://www.paulscode.com
37
* </b>
38
*/
39
public class SoundSystemException extends Exception
40
{
41
/**
42
* Global identifier for no problem.
43
*/
44
public static final int ERROR_NONE = 0;
45
/**
46
* Global identifier for a generic exception.
47
*/
48
public static final int UNKNOWN_ERROR = 1;
49
/**
50
* Global identifier for a null parameter.
51
*/
52
public static final int NULL_PARAMETER = 2;
53
/**
54
* Global identifier for a class type mismatch.
55
*/
56
public static final int CLASS_TYPE_MISMATCH = 3;
57
/**
58
* Global identifier for the sound library does not exist.
59
*/
60
public static final int LIBRARY_NULL = 4;
61
/**
62
* Global identifier for the sound library does not exist.
63
*/
64
public static final int LIBRARY_TYPE = 5;
65
66
/**
67
* Holds a global identifier indicating the type of exception.
68
*/
69
private int myType = UNKNOWN_ERROR;
70
71
/**
72
* Constructor: Generic exception. Specify the error message.
73
*/
74
public SoundSystemException( String message )
75
{
76
super( message );
77
}
78
79
/**
80
* Constructor: Specify the error message and type of exception.
81
* @param message Description of the problem.
82
* @param type Global identifier for type of exception.
83
*/
84
public SoundSystemException( String message, int type )
85
{
86
super( message );
87
myType = type;
88
}
89
90
public int getType()
91
{
92
return myType;
93
}
94
}
95
96