|
7 | 7 | /** |
8 | 8 | * The ⊥ ("bottom") object of φ-calculus — a terminated computation. |
9 | 9 | * |
10 | | - * <p>It carries no data and no attributes. Dataizing it aborts the |
11 | | - * program with an {@link ExFailure}, which EO {@code try} cannot catch |
12 | | - * (that object only intercepts {@link EOerror.ExError}), so reaching ⊥ |
13 | | - * terminates the program for good.</p> |
| 10 | + * <p>It has no data, no attributes, and no behaviour: every interaction |
| 11 | + * with it aborts the program through an {@link ExFailure}. Because EO |
| 12 | + * {@code try} only intercepts {@link EOerror.ExError}, this failure |
| 13 | + * cannot be caught, so touching ⊥ terminates the program for good.</p> |
14 | 14 | * |
15 | 15 | * @since 0.73.1 |
16 | 16 | */ |
17 | | -public final class PhTerminated extends PhDefault { |
| 17 | +public final class PhTerminated implements Phi { |
| 18 | + |
| 19 | + /** |
| 20 | + * The message of the failure raised by every interaction with ⊥. |
| 21 | + */ |
| 22 | + private static final String MESSAGE = |
| 23 | + "the ⊥ object is a terminated computation and cannot be used"; |
| 24 | + |
| 25 | + @Override |
| 26 | + public Phi copy() { |
| 27 | + throw new ExFailure(PhTerminated.MESSAGE); |
| 28 | + } |
| 29 | + |
| 30 | + @Override |
| 31 | + public boolean hasRho() { |
| 32 | + throw new ExFailure(PhTerminated.MESSAGE); |
| 33 | + } |
| 34 | + |
| 35 | + @Override |
| 36 | + public Phi take(final String name) { |
| 37 | + throw new ExFailure(PhTerminated.MESSAGE); |
| 38 | + } |
| 39 | + |
| 40 | + @Override |
| 41 | + public void put(final int pos, final Phi object) { |
| 42 | + throw new ExFailure(PhTerminated.MESSAGE); |
| 43 | + } |
| 44 | + |
| 45 | + @Override |
| 46 | + public void put(final String name, final Phi object) { |
| 47 | + throw new ExFailure(PhTerminated.MESSAGE); |
| 48 | + } |
| 49 | + |
| 50 | + @Override |
| 51 | + public String locator() { |
| 52 | + throw new ExFailure(PhTerminated.MESSAGE); |
| 53 | + } |
| 54 | + |
| 55 | + @Override |
| 56 | + public String forma() { |
| 57 | + throw new ExFailure(PhTerminated.MESSAGE); |
| 58 | + } |
18 | 59 |
|
19 | 60 | @Override |
20 | 61 | public byte[] delta() { |
21 | | - throw new ExFailure("the ⊥ object is a terminated computation and cannot be dataized"); |
| 62 | + throw new ExFailure(PhTerminated.MESSAGE); |
| 63 | + } |
| 64 | + |
| 65 | + @Override |
| 66 | + public String φTerm() { |
| 67 | + throw new ExFailure(PhTerminated.MESSAGE); |
22 | 68 | } |
23 | 69 | } |
0 commit comments