java/RAII/src/cz/frantovo/priklady/raii/Chyba.java
author František Kučera <franta-hg@frantovo.cz>
Fri, 15 May 2020 20:32:37 +0200
changeset 59 d6614ad97bed
parent 21 627912dacae3
permissions -rw-r--r--
LV2: modul zesilovače, dle oficiálního příkladu, ale bez závislosti na Pythonu – stačí gcc a make
franta-hg@21
     1
/**
franta-hg@21
     2
 * RAII v Javě
franta-hg@21
     3
 * Copyright © 2014 František Kučera (frantovo.cz)
franta-hg@21
     4
 *
franta-hg@21
     5
 * This program is free software: you can redistribute it and/or modify
franta-hg@21
     6
 * it under the terms of the GNU General Public License as published by
franta-hg@21
     7
 * the Free Software Foundation, either version 3 of the License, or
franta-hg@21
     8
 * (at your option) any later version.
franta-hg@21
     9
 *
franta-hg@21
    10
 * This program is distributed in the hope that it will be useful,
franta-hg@21
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
franta-hg@21
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
franta-hg@21
    13
 * GNU General Public License for more details.
franta-hg@21
    14
 *
franta-hg@21
    15
 * You should have received a copy of the GNU General Public License
franta-hg@21
    16
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
franta-hg@21
    17
 */
franta-hg@21
    18
package cz.frantovo.priklady.raii;
franta-hg@21
    19
franta-hg@21
    20
/**
franta-hg@21
    21
 *
franta-hg@21
    22
 * @author Ing. František Kučera (frantovo.cz)
franta-hg@21
    23
 */
franta-hg@21
    24
public class Chyba extends Exception {
franta-hg@21
    25
franta-hg@21
    26
	private final Zdroj zdroj;
franta-hg@21
    27
franta-hg@21
    28
	public Chyba(Zdroj zdroj) {
franta-hg@21
    29
		this.zdroj = zdroj;
franta-hg@21
    30
	}
franta-hg@21
    31
franta-hg@21
    32
	@Override
franta-hg@21
    33
	public String toString() {
franta-hg@21
    34
		return getClass().getSimpleName() + ": " + zdroj;
franta-hg@21
    35
	}
franta-hg@21
    36
franta-hg@21
    37
}