当前位置: 首页>>代码示例>>Java>>正文


Java InterfaceType类代码示例

本文整理汇总了Java中com.sun.jdi.InterfaceType的典型用法代码示例。如果您正苦于以下问题:Java InterfaceType类的具体用法?Java InterfaceType怎么用?Java InterfaceType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


InterfaceType类属于com.sun.jdi包,在下文中一共展示了InterfaceType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: allMethods

import com.sun.jdi.InterfaceType; //导入依赖的package包/类
/**
 * Shared implementation of {@linkplain ClassType#allMethods()} and
 * {@linkplain InterfaceType#allMethods()}
 * @return A list of all methods (recursively)
 */
public final List<Method> allMethods() {
    ArrayList<Method> list = new ArrayList<>(methods());
    ClassType clazz = superclass();
    while (clazz != null) {
        list.addAll(clazz.methods());
        clazz = clazz.superclass();
    }
    /*
     * Avoid duplicate checking on each method by iterating through
     * duplicate-free allInterfaces() rather than recursing
     */
    for (InterfaceType interfaze : getAllInterfaces()) {
        list.addAll(interfaze.methods());
    }
    return list;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:22,代码来源:InvokableTypeImpl.java

示例2: isF3Type

import com.sun.jdi.InterfaceType; //导入依赖的package包/类
/**
 * JDI addition: Determines if this is a F3 class.
 *
 * @return <code>true</code> if this is a F3 class; false otherwise.
 */
@Override
public boolean isF3Type() {
    if (!isIsF3TypeSet) {
        isIsF3TypeSet = true;
        F3VirtualMachine f3vm = virtualMachine();
        InterfaceType f3ObjType = (InterfaceType) F3Wrapper.unwrap(f3vm.f3ObjectType());
        if (f3ObjType != null) {
            ClassType thisType = underlying();
            List<InterfaceType> allIfaces = thisType.allInterfaces();
            for (InterfaceType iface : allIfaces) {
                if (iface.equals(f3ObjType)) {
                    isF3Type = true;
                    break;
                }
            }
        }
    }
    return isF3Type;
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:25,代码来源:F3ClassType.java

示例3: isAssignableTo

import com.sun.jdi.InterfaceType; //导入依赖的package包/类
@Override
boolean isAssignableTo(ReferenceType type) {
    ClassTypeImpl superclazz = (ClassTypeImpl) superclass();
    if (this.equals(type)) {
        return true;
    } else if ((superclazz != null) && superclazz.isAssignableTo(type)) {
        return true;
    } else {
        List<InterfaceType> interfaces = interfaces();
        Iterator<InterfaceType> iter = interfaces.iterator();
        while (iter.hasNext()) {
            InterfaceTypeImpl interfaze = (InterfaceTypeImpl) iter.next();
            if (interfaze.isAssignableTo(type)) {
                return true;
            }
        }
        return false;
    }
}
 
开发者ID:frohoff,项目名称:jdk8u-dev-jdk,代码行数:20,代码来源:InvokableTypeImpl.java

示例4: handleInterfaceLoad

import com.sun.jdi.InterfaceType; //导入依赖的package包/类
private void handleInterfaceLoad(final InterfaceType intfType, final ThreadReference thread)
{
  // do not proceed if this part of the hierarchy has been processed
  if (contourFactory().lookupStaticContour(intfType.name()) == null)
  {
    // update the meta-data for this type and all other types in its file
    resolveType(intfType);
    // recursively create the schemas, as necessary
    final List<?> superTypes = intfType.superinterfaces();
    for (final Object o : superTypes)
    {
      final InterfaceType superType = (InterfaceType) o;
      handleInterfaceLoad(superType, thread);
    }
    // all interfaces are either top-level or static;
    // we only create a contour if the interface declares fields
    if (intfType.fields().size() > 0)
    {
      // creates and dispatches a type load event for this type
      manager().jiveDispatcher().dispatchLoadEvent(intfType, thread);
    }
  }
}
 
开发者ID:UBPL,项目名称:jive,代码行数:24,代码来源:JDIEventHandlerDelegate.java

示例5: addVisibleMethods

import com.sun.jdi.InterfaceType; //导入依赖的package包/类
@Override
final void addVisibleMethods(Map<String, Method> methodMap, Set<InterfaceType> seenInterfaces) {
    /*
     * Add methods from
     * parent types first, so that the methods in this class will
     * overwrite them in the hash table
     */
    Iterator<InterfaceType> iter = interfaces().iterator();
    while (iter.hasNext()) {
        InterfaceTypeImpl interfaze = (InterfaceTypeImpl) iter.next();
        if (!seenInterfaces.contains(interfaze)) {
            interfaze.addVisibleMethods(methodMap, seenInterfaces);
            seenInterfaces.add(interfaze);
        }
    }
    ClassTypeImpl clazz = (ClassTypeImpl) superclass();
    if (clazz != null) {
        clazz.addVisibleMethods(methodMap, seenInterfaces);
    }
    addToMethodMap(methodMap, methods());
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:InvokableTypeImpl.java

示例6: writeLocation

import com.sun.jdi.InterfaceType; //导入依赖的package包/类
void writeLocation(Location location) {
    ReferenceTypeImpl refType = (ReferenceTypeImpl)location.declaringType();
    byte tag;
    if (refType instanceof ClassType) {
        tag = JDWP.TypeTag.CLASS;
    } else if (refType instanceof InterfaceType) {
        // It's possible to have executable code in an interface
        tag = JDWP.TypeTag.INTERFACE;
    } else {
        throw new InternalException("Invalid Location");
    }
    writeByte(tag);
    writeClassRef(refType.ref());
    writeMethodRef(((MethodImpl)location.method()).ref());
    writeLong(location.codeIndex());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:PacketStream.java

示例7: visibleMethods

import com.sun.jdi.InterfaceType; //导入依赖的package包/类
public List<Method> visibleMethods() {
    /*
     * Build a collection of all visible methods. The hash
     * map allows us to do this efficiently by keying on the
     * concatenation of name and signature.
     */
    Map<String, Method> map = new HashMap<String, Method>();
    addVisibleMethods(map, new HashSet<InterfaceType>());

    /*
     * ... but the hash map destroys order. Methods should be
     * returned in a sensible order, as they are in allMethods().
     * So, start over with allMethods() and use the hash map
     * to filter that ordered collection.
     */
    List<Method> list = allMethods();
    list.retainAll(new HashSet<Method>(map.values()));
    return list;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:ReferenceTypeImpl.java

示例8: isAssignableTo

import com.sun.jdi.InterfaceType; //导入依赖的package包/类
boolean isAssignableTo(ReferenceType destType) {
    if (destType instanceof ArrayType) {
        try {
            Type destComponentType = ((ArrayType)destType).componentType();
            return isComponentAssignable(destComponentType, componentType());
        } catch (ClassNotLoadedException e) {
            // One or both component types has not yet been
            // loaded => can't assign
            return false;
        }
    } else if (destType instanceof InterfaceType) {
        // Only valid InterfaceType assignee is Cloneable
        return destType.name().equals("java.lang.Cloneable");
    } else {
        // Only valid ClassType assignee is Object
        return destType.name().equals("java.lang.Object");
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:ArrayTypeImpl.java

示例9: addVisibleMethods

import com.sun.jdi.InterfaceType; //导入依赖的package包/类
@Override
void addVisibleMethods(Map<String, Method> methodMap, Set<InterfaceType> seenInterfaces) {
    /*
     * Add methods from
     * parent types first, so that the methods in this class will
     * overwrite them in the hash table
     */
    Iterator<InterfaceType> iter = superinterfaces().iterator();
    while (iter.hasNext()) {
        InterfaceTypeImpl interfaze = (InterfaceTypeImpl)iter.next();
        if (!seenInterfaces.contains(interfaze)) {
            interfaze.addVisibleMethods(methodMap, seenInterfaces);
            seenInterfaces.add(interfaze);
        }
    }

    addToMethodMap(methodMap, methods());
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:19,代码来源:InterfaceTypeImpl.java

示例10: getAllMethods

import com.sun.jdi.InterfaceType; //导入依赖的package包/类
List getAllMethods() {
    ArrayList list = new ArrayList(methods());
    ClassType clazz = superclass();
    while (clazz != null) {
        list.addAll(clazz.methods());
        clazz = clazz.superclass();
    }
    /*
     * Avoid duplicate checking on each method by iterating through
     * duplicate-free allInterfaces() rather than recursing
     */
    Iterator iter = allInterfaces().iterator();
    while (iter.hasNext()) {
        InterfaceType interfaze = (InterfaceType)iter.next();
        list.addAll(interfaze.methods());
    }
    return list;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:19,代码来源:ClassTypeImpl.java

示例11: addVisibleMethods

import com.sun.jdi.InterfaceType; //导入依赖的package包/类
@Override
void addVisibleMethods(Map<String, Method> methodMap, Set<InterfaceType> seenInterfaces) {
    /*
     * Add methods from
     * parent types first, so that the methods in this class will
     * overwrite them in the hash table
     */

    Iterator<InterfaceType> iter = interfaces().iterator();
    while (iter.hasNext()) {
        InterfaceTypeImpl interfaze = (InterfaceTypeImpl)iter.next();
        if (!seenInterfaces.contains(interfaze)) {
            interfaze.addVisibleMethods(methodMap, seenInterfaces);
            seenInterfaces.add(interfaze);
        }
    }

    ClassTypeImpl clazz = (ClassTypeImpl)superclass();
    if (clazz != null) {
        clazz.addVisibleMethods(methodMap, seenInterfaces);
    }

    addToMethodMap(methodMap, methods());
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:25,代码来源:ClassTypeImpl.java

示例12: isAssignableTo

import com.sun.jdi.InterfaceType; //导入依赖的package包/类
boolean isAssignableTo(ReferenceType destType) {
    if (destType instanceof ArrayType) {
        try {
            Type destComponentType = ((ArrayType)destType).componentType();
            return isComponentAssignable(destComponentType, componentType());
        } catch (ClassNotLoadedException e) {
            // One or both component types has not yet been
            // loaded => can't assign
            return false;
        }
    } else {
        Symbol typeName = ((ReferenceTypeImpl)destType).typeNameAsSymbol();
        if (destType instanceof InterfaceType) {
            // Every array type implements java.io.Serializable and
            // java.lang.Cloneable. fixme in JVMDI-JDI, includes only
            // Cloneable but not Serializable.
            return typeName.equals(vm.javaLangCloneable()) ||
                   typeName.equals(vm.javaIoSerializable());
        } else {
            // Only valid ClassType assignee is Object
            return typeName.equals(vm.javaLangObject());
        }
    }
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:25,代码来源:ArrayTypeImpl.java

示例13: getCastableRuntimeType

import com.sun.jdi.InterfaceType; //导入依赖的package包/类
@Nullable
public static PsiType getCastableRuntimeType(Project project, Value value) {
  Type type = value.type();
  PsiType psiType = findPsiType(project, type);
  if (psiType != null) {
    return psiType;
  }

  if (type instanceof ClassType) {
    ClassType superclass = ((ClassType)type).superclass();
    if (superclass != null && !CommonClassNames.JAVA_LANG_OBJECT.equals(superclass.name())) {
      psiType = findPsiType(project, superclass);
      if (psiType != null) {
        return psiType;
      }
    }

    for (InterfaceType interfaceType : ((ClassType)type).interfaces()) {
      psiType = findPsiType(project, interfaceType);
      if (psiType != null) {
        return psiType;
      }
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:RuntimeTypeEvaluator.java

示例14: isF3Type

import com.sun.jdi.InterfaceType; //导入依赖的package包/类
/**
 * JDI addition: Determines if this is a F3 type.
 *
 * @return <code>true</code> if this is a F3 type; false otherwise.
 */
public boolean isF3Type() {
    if (!isIsF3TypeSet) {
        isIsF3TypeSet = true;
        F3VirtualMachine f3vm = virtualMachine();
        InterfaceType f3ObjType = (InterfaceType) F3Wrapper.unwrap(f3vm.f3ObjectType());
        if (f3ObjType != null) {
            InterfaceType thisType = underlying();
            List<InterfaceType> allIfaces = thisType.superinterfaces();
            for (InterfaceType iface : allIfaces) {
                if (iface.equals(f3ObjType)) {
                    isF3Type = true;
                    break;
                }
            }
        }
    }
    return isF3Type;
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:24,代码来源:F3InterfaceType.java

示例15: getCastableRuntimeType

import com.sun.jdi.InterfaceType; //导入依赖的package包/类
public static PsiClass getCastableRuntimeType(Project project, Value value) {
  Type type = value.type();
  PsiClass psiClass = findPsiClass(project, type);
  if (psiClass != null) {
    return psiClass;
  }

  if (type instanceof ClassType) {
    ClassType superclass = ((ClassType)type).superclass();
    if (superclass != null && !CommonClassNames.JAVA_LANG_OBJECT.equals(superclass.name())) {
      psiClass = findPsiClass(project, superclass);
      if (psiClass != null) {
        return psiClass;
      }
    }

    for (InterfaceType interfaceType : ((ClassType)type).interfaces()) {
      psiClass = findPsiClass(project, interfaceType);
      if (psiClass != null) {
        return psiClass;
      }
    }
  }
  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:RuntimeTypeEvaluator.java


注:本文中的com.sun.jdi.InterfaceType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。