Tabnine Logo
FastHierarchy.getAllSubinterfaces
Code IndexAdd Tabnine to your IDE (free)

How to use
getAllSubinterfaces
method
in
soot.FastHierarchy

Best Java code snippets using soot.FastHierarchy.getAllSubinterfaces (Showing top 9 results out of 315)

origin: Sable/soot

/**
 * For an interface parent (MUST be an interface), returns set of all subinterfaces including <code>parent</code>.
 *
 * This method can be used concurrently (is thread safe).
 *
 * @param parent
 *          the parent interface.
 * @return an set, possibly empty
 */
public Set<SootClass> getAllSubinterfaces(SootClass parent) {
 parent.checkLevel(SootClass.HIERARCHY);
 if (!parent.isInterface()) {
  return Collections.emptySet();
 }
 Set<SootClass> result = interfaceToAllSubinterfaces.get(parent);
 if (result.size() > 0) {
  return result;
 }
 result = new HashSet<>();
 result.add(parent);
 for (SootClass si : interfaceToSubinterfaces.get(parent)) {
  result.addAll(getAllSubinterfaces(si));
 }
 interfaceToAllSubinterfaces.putAll(parent, result);
 return result;
}
origin: Sable/soot

/**
 * For an interface parent (MUST be an interface), returns set of all implementers of it but NOT their subclasses.
 * 
 * This method can be used concurrently (is thread safe).
 * 
 * @param parent
 *          the parent interface.
 * @return an set, possibly empty
 */
public Set<SootClass> getAllImplementersOfInterface(SootClass parent) {
 parent.checkLevel(SootClass.HIERARCHY);
 Set<SootClass> result = interfaceToAllImplementers.get(parent);
 if (result.size() > 0) {
  return result;
 }
 result = new HashSet<>();
 for (SootClass subinterface : getAllSubinterfaces(parent)) {
  if (subinterface == parent) {
   continue;
  }
  result.addAll(getAllImplementersOfInterface(subinterface));
 }
 result.addAll(interfaceToImplementers.get(parent));
 interfaceToAllImplementers.putAll(parent, result);
 return result;
}
origin: Sable/soot

 return parent == rtObject.getSootClass();
} else {
 return getAllSubinterfaces(parent).contains(child);
origin: ibinti/bugvm

/** For an interface parent (MUST be an interface), returns set of all
 * subinterfaces. */
protected Set getAllSubinterfaces( SootClass parent ) {
  parent.checkLevel(SootClass.HIERARCHY);
  if( !interfaceToAllSubinterfaces.containsKey( parent ) ) {
    interfaceToAllSubinterfaces.put( parent, parent );
    for( Iterator it = interfaceToSubinterfaces.get( parent ).iterator(); it.hasNext(); ) {
      interfaceToAllSubinterfaces.putAll(parent, 
        getAllSubinterfaces( (SootClass) it.next() ) );
    }
  }
  return interfaceToAllSubinterfaces.get( parent );
}
origin: com.bugvm/bugvm-soot

/** For an interface parent (MUST be an interface), returns set of all
 * subinterfaces. */
protected Set getAllSubinterfaces( SootClass parent ) {
  parent.checkLevel(SootClass.HIERARCHY);
  if( !interfaceToAllSubinterfaces.containsKey( parent ) ) {
    interfaceToAllSubinterfaces.put( parent, parent );
    for( Iterator it = interfaceToSubinterfaces.get( parent ).iterator(); it.hasNext(); ) {
      interfaceToAllSubinterfaces.putAll(parent, 
        getAllSubinterfaces( (SootClass) it.next() ) );
    }
  }
  return interfaceToAllSubinterfaces.get( parent );
}
origin: ibinti/bugvm

/** Given an object of declared type child, returns true if the object
 * can be stored in a variable of type parent. If child is an interface
 * that is not a subinterface of parent, this method will return false
 * even though some objects implementing the child interface may also
 * implement the parent interface. */
protected boolean canStoreClass( SootClass child, SootClass parent ) {
  parent.checkLevel(SootClass.HIERARCHY);
  child.checkLevel(SootClass.HIERARCHY);
  Interval parentInterval = classToInterval.get( parent );
  Interval childInterval = classToInterval.get( child );
  if( parentInterval != null && childInterval != null ) {
    return parentInterval.isSubrange( childInterval );
  }
  if( childInterval == null ) { // child is interface
    if( parentInterval != null ) { // parent is not interface
      return parent.equals( RefType.v("java.lang.Object").getSootClass() );
    } else {
      return getAllSubinterfaces( parent ).contains( child );
    }
  } else {
    Set impl = getAllImplementersOfInterface( parent );
    for( Iterator it = impl.iterator(); it.hasNext(); ) {
      parentInterval = classToInterval.get( it.next() );
      if( parentInterval != null && parentInterval.isSubrange( childInterval ) ) {
        return true;
      }
    }
    return false;
  }
}
origin: com.bugvm/bugvm-soot

/** Given an object of declared type child, returns true if the object
 * can be stored in a variable of type parent. If child is an interface
 * that is not a subinterface of parent, this method will return false
 * even though some objects implementing the child interface may also
 * implement the parent interface. */
protected boolean canStoreClass( SootClass child, SootClass parent ) {
  parent.checkLevel(SootClass.HIERARCHY);
  child.checkLevel(SootClass.HIERARCHY);
  Interval parentInterval = classToInterval.get( parent );
  Interval childInterval = classToInterval.get( child );
  if( parentInterval != null && childInterval != null ) {
    return parentInterval.isSubrange( childInterval );
  }
  if( childInterval == null ) { // child is interface
    if( parentInterval != null ) { // parent is not interface
      return parent.equals( RefType.v("java.lang.Object").getSootClass() );
    } else {
      return getAllSubinterfaces( parent ).contains( child );
    }
  } else {
    Set impl = getAllImplementersOfInterface( parent );
    for( Iterator it = impl.iterator(); it.hasNext(); ) {
      parentInterval = classToInterval.get( it.next() );
      if( parentInterval != null && parentInterval.isSubrange( childInterval ) ) {
        return true;
      }
    }
    return false;
  }
}
origin: ibinti/bugvm

/** For an interface parent (MUST be an interface), returns set of all
 * implementers of it but NOT their subclasses. */
public Set getAllImplementersOfInterface( SootClass parent ) {
  parent.checkLevel(SootClass.HIERARCHY);
  if( !interfaceToAllImplementers.containsKey( parent ) ) {
    for( Iterator subinterfaceIt = getAllSubinterfaces( parent ).iterator(); subinterfaceIt.hasNext(); ) {
      final SootClass subinterface = (SootClass) subinterfaceIt.next();
      if( subinterface == parent ) continue;
      interfaceToAllImplementers.putAll(parent,
        getAllImplementersOfInterface( subinterface ) );
    }
    interfaceToAllImplementers.putAll(parent, 
        interfaceToImplementers.get( parent ) );
  }
  return interfaceToAllImplementers.get( parent );
}
origin: com.bugvm/bugvm-soot

/** For an interface parent (MUST be an interface), returns set of all
 * implementers of it but NOT their subclasses. */
public Set getAllImplementersOfInterface( SootClass parent ) {
  parent.checkLevel(SootClass.HIERARCHY);
  if( !interfaceToAllImplementers.containsKey( parent ) ) {
    for( Iterator subinterfaceIt = getAllSubinterfaces( parent ).iterator(); subinterfaceIt.hasNext(); ) {
      final SootClass subinterface = (SootClass) subinterfaceIt.next();
      if( subinterface == parent ) continue;
      interfaceToAllImplementers.putAll(parent,
        getAllImplementersOfInterface( subinterface ) );
    }
    interfaceToAllImplementers.putAll(parent, 
        interfaceToImplementers.get( parent ) );
  }
  return interfaceToAllImplementers.get( parent );
}
sootFastHierarchygetAllSubinterfaces

Javadoc

For an interface parent (MUST be an interface), returns set of all subinterfaces.

Popular methods of FastHierarchy

  • canStoreType
    Given an object of declared type child, returns true if the object can be stored in a variable of ty
  • isSubclass
    Return true if class child is a subclass of class parent, neither of them being allowed to be interf
  • <init>
    Constructs a hierarchy from the current scene.
  • canStoreClass
    Given an object of declared type child, returns true if the object can be stored in a variable of ty
  • dfsVisit
  • getAllImplementersOfInterface
    For an interface parent (MUST be an interface), returns set of all implementers of it but NOT their
  • getSubclassesOf
  • isVisible
    Returns true if the method m is visible from code in the class from.
  • resolveConcreteDispatch
    Given an object of actual type C (o = new C()), returns the method which will be called on an o.f()
  • put
  • canStoreClassClassic
    "Classic" implementation using the intuitive approach (without using Interval) to check whetherchild
  • resolveAbstractDispatch
    Given an object of declared type C, returns the methods which could be called on an o.f() invocation
  • canStoreClassClassic,
  • resolveAbstractDispatch

Popular in Java

  • Running tasks concurrently on multiple threads
  • compareTo (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • findViewById (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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