| author | wenzelm |
| Fri, 27 Jan 2023 15:33:21 +0100 | |
| changeset 77109 | e3a2b3536030 |
| child 77114 | 6608de52a3b5 |
| permissions | -rw-r--r-- |
|
77109
e3a2b3536030
prefer typed bytes count, but retain toString of original Long for robustness of Java/Scala string composition;
wenzelm
parents:
diff
changeset
|
1 |
/* Title: Pure/General/space.scala |
|
e3a2b3536030
prefer typed bytes count, but retain toString of original Long for robustness of Java/Scala string composition;
wenzelm
parents:
diff
changeset
|
2 |
Author: Makarius |
|
e3a2b3536030
prefer typed bytes count, but retain toString of original Long for robustness of Java/Scala string composition;
wenzelm
parents:
diff
changeset
|
3 |
|
|
e3a2b3536030
prefer typed bytes count, but retain toString of original Long for robustness of Java/Scala string composition;
wenzelm
parents:
diff
changeset
|
4 |
Storage space based on bytes. |
|
e3a2b3536030
prefer typed bytes count, but retain toString of original Long for robustness of Java/Scala string composition;
wenzelm
parents:
diff
changeset
|
5 |
*/ |
|
e3a2b3536030
prefer typed bytes count, but retain toString of original Long for robustness of Java/Scala string composition;
wenzelm
parents:
diff
changeset
|
6 |
|
|
e3a2b3536030
prefer typed bytes count, but retain toString of original Long for robustness of Java/Scala string composition;
wenzelm
parents:
diff
changeset
|
7 |
package isabelle |
|
e3a2b3536030
prefer typed bytes count, but retain toString of original Long for robustness of Java/Scala string composition;
wenzelm
parents:
diff
changeset
|
8 |
|
|
e3a2b3536030
prefer typed bytes count, but retain toString of original Long for robustness of Java/Scala string composition;
wenzelm
parents:
diff
changeset
|
9 |
|
|
e3a2b3536030
prefer typed bytes count, but retain toString of original Long for robustness of Java/Scala string composition;
wenzelm
parents:
diff
changeset
|
10 |
object Space {
|
|
e3a2b3536030
prefer typed bytes count, but retain toString of original Long for robustness of Java/Scala string composition;
wenzelm
parents:
diff
changeset
|
11 |
def bytes(bs: Long): Space = new Space(bs) |
|
e3a2b3536030
prefer typed bytes count, but retain toString of original Long for robustness of Java/Scala string composition;
wenzelm
parents:
diff
changeset
|
12 |
val zero: Space = bytes(0L) |
|
e3a2b3536030
prefer typed bytes count, but retain toString of original Long for robustness of Java/Scala string composition;
wenzelm
parents:
diff
changeset
|
13 |
} |
|
e3a2b3536030
prefer typed bytes count, but retain toString of original Long for robustness of Java/Scala string composition;
wenzelm
parents:
diff
changeset
|
14 |
|
|
e3a2b3536030
prefer typed bytes count, but retain toString of original Long for robustness of Java/Scala string composition;
wenzelm
parents:
diff
changeset
|
15 |
final class Space private(val bytes: Long) extends AnyVal {
|
|
e3a2b3536030
prefer typed bytes count, but retain toString of original Long for robustness of Java/Scala string composition;
wenzelm
parents:
diff
changeset
|
16 |
override def toString: String = bytes.toString |
|
e3a2b3536030
prefer typed bytes count, but retain toString of original Long for robustness of Java/Scala string composition;
wenzelm
parents:
diff
changeset
|
17 |
} |