package jp.sourceforge.glad.collection.exception;

public class BreakException extends ControlException {

    private static final long serialVersionUID = 1L;

    final Object label;

    public BreakException() {
        this(null);
    }

    public BreakException(Object label) {
        this.label = label;
    }

    public Object getLabel() {
        return label;
    }

    @Override
    public String toString() {
        if (label == null) {
            return "break";
        } else {
            return "break " + label;
        }
    }

}
