Elffuss BraidHub

kikocis/java-driver public

Expose TokenRange#contains (JAVA-687).
Changeset0aeacc35956c58c5a3bd09517861a399e16fe1a8fe7db258298b1b5b54a56f32
Authorolim7t <omichallat+github@gmail.com> · 2015-03-11 20:15 +01:00
Committerolim7t <omichallat+github@gmail.com> · 2015-03-11 20:18 +01:00
Parentsa30aaa55e581

Browse the files at this changeset

2 files changed

modified driver-core/CHANGELOG.rst +1 −0
@@ -17,6 +17,7 @@
1717 - [bug] Quote single quotes contained in table comments in asCQLQuery method
1818 (JAVA-655)
1919 - [bug] Empty TokenRange returned in a one token cluster (JAVA-684)
20+- [improvement] Expose TokenRange#contains (JAVA-687)
2021
2122 Merged from 2.0.9_fixes branch:
2223
modified driver-core/src/main/java/com/datastax/driver/core/TokenRange.java +10 −0
@@ -213,6 +213,16 @@
213213 return intersected;
214214 }
215215
216+ /**
217+ * Checks whether this range contains a given token.
218+ *
219+ * @param token the token to check for.
220+ * @return whether this range contains the token, i.e. {@code range.start &lt; token &lt;= range.end}.
221+ */
222+ public boolean contains(Token token) {
223+ return contains(token, false);
224+ }
225+
216226 // isStart handles the case where the token is the start of another range, for example:
217227 // * ]1,2] contains 2, but it does not contain the start of ]2,3]
218228 // * ]1,2] does not contain 1, but it contains the start of ]1,3]