package org.psjava.ds.numbersystrem;

import org.psjava.util.AssertStatus;

public class InfinitableNumber<T> {

	public static <T> InfinitableNumber<T> getFiniteInstance(T value) {
		return new InfinitableNumber<T>(value);
	}

	public static <T> InfinitableNumber<T> getInfinity() {
		return new InfinitableNumber<T>(null);
	}

	private final T valueOrNull; // null means infinity

	private InfinitableNumber(T valueOrNull) {
		this.valueOrNull = valueOrNull;
	}

	public boolean isInfinity() {
		return valueOrNull == null;
	}

	public T getValue() {
		AssertStatus.assertTrue(valueOrNull != null);
		return valueOrNull;
	}

}

@@ -620,10 +620,115 @@
 ll;%0A%09%7D%0A%0A
+%09@Override%0A%09public String toString() %7B%0A%09%09return valueOrNull == null ? %22INF%22 : valueOrNull.toString();%0A%09%7D%0A
 %7D%0A

improve debug log