@Test public void containsPrefixRangeTest() { PrefixRange range = PrefixRange.fromString("10.10.10.0/20:16-24"); _ps.addPrefixRange(range); assertThat( "Ranges earlier than this range not included", _ps.containsPrefixRange(PrefixRange.fromString("10.10.10.0/20:15-24")), equalTo(false)); assertThat( "Ranges later than this range not included", _ps.containsPrefixRange(PrefixRange.fromString("10.10.10.0/20:18-26")), equalTo(false)); assertThat( "Ranges contained in this range included", _ps.containsPrefixRange(PrefixRange.fromString("10.10.10.0/20:18-20")), equalTo(true)); assertThat( "Range not included if prefix is shorter", _ps.containsPrefixRange(PrefixRange.fromString("10.10.10.0/8:16-24")), equalTo(false)); assertThat( "Range included if prefix is longer", _ps.containsPrefixRange(PrefixRange.fromString("10.10.10.0/28:16-24")), equalTo(true)); }
public boolean containsPrefixRange(PrefixRange prefixRange) { return _trie.containsPrefixRange(prefixRange); }
PrefixSpace implements Serializable { public boolean containsPrefixRange(PrefixRange prefixRange) { return _trie.containsPrefixRange(prefixRange); } }
PrefixSpace implements Serializable { public boolean containsPrefixRange(PrefixRange prefixRange) { return _trie.containsPrefixRange(prefixRange); } PrefixSpace(); @JsonCreator  PrefixSpace(Iterable<PrefixRange> prefixRanges);  PrefixSpace(PrefixRange... prefixRanges); }
PrefixSpace implements Serializable { public boolean containsPrefixRange(PrefixRange prefixRange) { return _trie.containsPrefixRange(prefixRange); } PrefixSpace(); @JsonCreator  PrefixSpace(Iterable<PrefixRange> prefixRanges);  PrefixSpace(PrefixRange... prefixRanges); void addPrefix(Prefix prefix); void addPrefixRange(PrefixRange prefixRange); void addSpace(PrefixSpace prefixSpace); boolean containsPrefix(Prefix prefix); boolean containsPrefixRange(PrefixRange prefixRange); @Override boolean equals(Object obj); Set<PrefixRange> getPrefixRanges(); @Override int hashCode(); PrefixSpace intersection(PrefixSpace intersectSpace); @JsonIgnore boolean isEmpty(); boolean overlaps(PrefixSpace intersectSpace); @Override String toString(); }
PrefixSpace implements Serializable { public boolean containsPrefixRange(PrefixRange prefixRange) { return _trie.containsPrefixRange(prefixRange); } PrefixSpace(); @JsonCreator  PrefixSpace(Iterable<PrefixRange> prefixRanges);  PrefixSpace(PrefixRange... prefixRanges); void addPrefix(Prefix prefix); void addPrefixRange(PrefixRange prefixRange); void addSpace(PrefixSpace prefixSpace); boolean containsPrefix(Prefix prefix); boolean containsPrefixRange(PrefixRange prefixRange); @Override boolean equals(Object obj); Set<PrefixRange> getPrefixRanges(); @Override int hashCode(); PrefixSpace intersection(PrefixSpace intersectSpace); @JsonIgnore boolean isEmpty(); boolean overlaps(PrefixSpace intersectSpace); @Override String toString();  }