Last active
September 3, 2019 05:54
-
-
Save davideanastasia/1e63c8a3f5c51636a80d39e869032a0d to your computer and use it in GitHub Desktop.
spatial_beam_01.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TiledIntervalWindow extends BoundedWindow { | |
private final String hexAddr; | |
private final Instant start; | |
private final Instant end; | |
public TiledIntervalWindow(String hexAddr, Instant start, Instant end) { | |
this.hexAddr = hexAddr; | |
this.start = start; | |
this.end = end; | |
} | |
// ... | |
private boolean isDisjoint(TiledIntervalWindow other) { | |
return !this.end.isAfter(other.start) || !other.end.isAfter(this.start); | |
} | |
public boolean intersects(TiledIntervalWindow other) { | |
return this.hexAddr.equals(other.hexAddr) && !this.isDisjoint(other); | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment