congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
IpSpaceAssignment$Entry.getLocations
Code IndexAdd Tabnine to your IDE (free)

How to use
getLocations
method
in
org.batfish.specifier.IpSpaceAssignment$Entry

Best Java code snippets using org.batfish.specifier.IpSpaceAssignment$Entry.getLocations (Showing top 6 results out of 315)

origin: batfish/batfish

private Map<StateExpr, BDD> rootConstraints(
  IpSpaceAssignment srcIpSpaceAssignment, BDD initialHeaderSpaceBdd) {
 LocationVisitor<Optional<StateExpr>> locationToStateExpr = getLocationToStateExpr();
 IpSpaceToBDD srcIpSpaceToBDD =
   new MemoizedIpSpaceToBDD(_bddPacket.getSrcIp(), ImmutableMap.of());
 // convert Locations to StateExprs, and merge srcIp constraints
 Map<StateExpr, BDD> rootConstraints = new HashMap<>();
 for (IpSpaceAssignment.Entry entry : srcIpSpaceAssignment.getEntries()) {
  BDD srcIpSpaceBDD = entry.getIpSpace().accept(srcIpSpaceToBDD);
  entry.getLocations().stream()
    .map(locationToStateExpr::visit)
    .filter(Optional::isPresent)
    .map(Optional::get)
    .forEach(root -> rootConstraints.merge(root, srcIpSpaceBDD, BDD::or));
 }
 // add the global initial HeaderSpace and remove unsat entries
 Map<StateExpr, BDD> finalRootConstraints =
   rootConstraints.entrySet().stream()
     .map(
       entry ->
         Maps.immutableEntry(
           entry.getKey(), entry.getValue().and(initialHeaderSpaceBdd)))
     .filter(entry -> !entry.getValue().isZero())
     .collect(ImmutableMap.toImmutableMap(Entry::getKey, Entry::getValue));
 // make sure there is at least one possible source
 checkArgument(
   !finalRootConstraints.isEmpty(),
   "No sources are compatible with the headerspace constraint");
 return finalRootConstraints;
}
origin: batfish/batfish

.filter(e -> e.getLocations().contains(srcLocation))
.findFirst();
origin: batfish/batfish

.filter(e -> e.getLocations().contains(srcLocation))
.findFirst();
origin: batfish/batfish

.flatMap(entry -> entry.getLocations().stream())
.collect(ImmutableSet.toImmutableSet());
origin: batfish/batfish

entry ->
  entry
    .getLocations()
    .forEach(
      location ->
origin: batfish/batfish

@VisibleForTesting
static TableAnswerElement resolveIpSpaceOfLocation(
  SpecifiersQuestion question, SpecifierContext context) {
 List<ColumnMetadata> columns =
   ImmutableList.of(
     new ColumnMetadata(COL_LOCATIONS, Schema.STRING, "Resolution", false, false),
     new ColumnMetadata(COL_IP_SPACE, Schema.STRING, "IP space", false, false));
 TableAnswerElement table = new TableAnswerElement(new TableMetadata(columns));
 Map<String, ColumnMetadata> columnMap = table.getMetadata().toColumnMap();
 Set<Location> locations = question.getLocationSpecifier().resolve(context);
 IpSpaceAssignment ipSpaceAssignment =
   question.getIpSpaceSpecifier().resolve(locations, context);
 for (IpSpaceAssignment.Entry entry : ipSpaceAssignment.getEntries()) {
  table.addRow(
    Row.of(
      columnMap,
      COL_LOCATIONS,
      entry.getLocations().toString(),
      COL_IP_SPACE,
      Objects.toString(entry.getIpSpace())));
 }
 return table;
}
org.batfish.specifierIpSpaceAssignment$EntrygetLocations

Popular methods of IpSpaceAssignment$Entry

  • getIpSpace
  • <init>

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (Timer)
  • runOnUiThread (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now