@Test public void testMatchCommunity() { CommunityHalvesExpr expr = new CommunityHalvesExpr(new LiteralCommunityHalf(1), new LiteralCommunityHalf(1)); assertThat(expr, matchCommunity(null, StandardCommunity.parse("1:1"))); assertThat(expr, not(matchCommunity(null, StandardCommunity.of(2L)))); }
@Override public boolean matchCommunity(Environment environment, Community community) { if (!(community instanceof StandardCommunity)) { return false; } return _left.matches(((StandardCommunity) community).high()) && _right.matches(((StandardCommunity) community).low()); }
CommunityHalvesExpr extends CommunitySetExpr { @Override public boolean matchCommunity(Environment environment, Community community) { if (!(community instanceof StandardCommunity)) { return false; } return _left.matches(((StandardCommunity) community).high()) && _right.matches(((StandardCommunity) community).low()); } }
CommunityHalvesExpr extends CommunitySetExpr { @Override public boolean matchCommunity(Environment environment, Community community) { if (!(community instanceof StandardCommunity)) { return false; } return _left.matches(((StandardCommunity) community).high()) && _right.matches(((StandardCommunity) community).low()); } CommunityHalvesExpr(@Nonnull CommunityHalfExpr left, @Nonnull CommunityHalfExpr right); }
CommunityHalvesExpr extends CommunitySetExpr { @Override public boolean matchCommunity(Environment environment, Community community) { if (!(community instanceof StandardCommunity)) { return false; } return _left.matches(((StandardCommunity) community).high()) && _right.matches(((StandardCommunity) community).low()); } CommunityHalvesExpr(@Nonnull CommunityHalfExpr left, @Nonnull CommunityHalfExpr right); @Override T accept(CommunitySetExprVisitor<T> visitor); @Override void accept(VoidCommunitySetExprVisitor visitor); @Nonnull @Override Set<Community> asLiteralCommunities(@Nonnull Environment environment); @Override boolean dynamicMatchCommunity(); @Override boolean equals(Object obj); @JsonProperty(PROP_LEFT) @Nonnull CommunityHalfExpr getLeft(); @JsonProperty(PROP_RIGHT) @Nonnull CommunityHalfExpr getRight(); @Override int hashCode(); @Override boolean matchCommunities(Environment environment, Set<Community> communitySetCandidate); @Override boolean matchCommunity(Environment environment, Community community); @Override boolean reducible(); @Override String toString(); }
CommunityHalvesExpr extends CommunitySetExpr { @Override public boolean matchCommunity(Environment environment, Community community) { if (!(community instanceof StandardCommunity)) { return false; } return _left.matches(((StandardCommunity) community).high()) && _right.matches(((StandardCommunity) community).low()); } CommunityHalvesExpr(@Nonnull CommunityHalfExpr left, @Nonnull CommunityHalfExpr right); @Override T accept(CommunitySetExprVisitor<T> visitor); @Override void accept(VoidCommunitySetExprVisitor visitor); @Nonnull @Override Set<Community> asLiteralCommunities(@Nonnull Environment environment); @Override boolean dynamicMatchCommunity(); @Override boolean equals(Object obj); @JsonProperty(PROP_LEFT) @Nonnull CommunityHalfExpr getLeft(); @JsonProperty(PROP_RIGHT) @Nonnull CommunityHalfExpr getRight(); @Override int hashCode(); @Override boolean matchCommunities(Environment environment, Set<Community> communitySetCandidate); @Override boolean matchCommunity(Environment environment, Community community); @Override boolean reducible(); @Override String toString();  }