Text.Range.is_singleton;
authorwenzelm
Tue, 24 Aug 2010 23:49:07 +0200
changeset 38662 4d4553e09337
parent 38661 f1ba2ae8e58a
child 38663 fcd56e6a04b9
Text.Range.is_singleton;
src/Pure/PIDE/text.scala
--- a/src/Pure/PIDE/text.scala	Tue Aug 24 21:34:38 2010 +0200
+++ b/src/Pure/PIDE/text.scala	Tue Aug 24 23:49:07 2010 +0200
@@ -32,6 +32,9 @@
     def map(f: Offset => Offset): Range = Range(f(start), f(stop))
     def +(i: Offset): Range = map(_ + i)
     def -(i: Offset): Range = map(_ - i)
+
+    def is_singleton: Boolean = start == stop
+
     def contains(i: Offset): Boolean = start == i || start < i && i < stop
     def contains(that: Range): Boolean = this.contains(that.start) && that.stop <= this.stop
     def overlaps(that: Range): Boolean = this.contains(that.start) || that.contains(this.start)