public boolean isAssignableFrom( IType type ) { return type.getAllTypesInHierarchy().contains( this ); } public boolean isAssignableFrom( IType type, boolean bContravariant )
public boolean isAssignableFrom( IType type ) { return type.getAllTypesInHierarchy().contains( this ); }
public boolean isAssignableFrom(IType type) { return type.getAllTypesInHierarchy().contains( this ); }
@Override public Set<? extends IType> getAllTypesInHierarchy() { Set<IType> allTypes = new HashSet<IType>(); for (IType iType : _types) { allTypes.addAll(iType.getAllTypesInHierarchy()); } allTypes.add( this ); return allTypes; }
@Override public Set<? extends IType> getAllTypesInHierarchy() { Set<IType> allTypes = new HashSet<IType>(); for (IType iType : _types) { allTypes.addAll(iType.getAllTypesInHierarchy()); } allTypes.add( this ); return allTypes; }
private static void pruneNonLUBs( Set<IType> typeSet ) { for( Iterator<IType> outerIterator = typeSet.iterator(); outerIterator.hasNext(); ) { IType typeToPossiblyRemove = outerIterator.next(); for( IType otherType : typeSet ) { //noinspection SuspiciousMethodCalls if( otherType.getAllTypesInHierarchy().contains( typeToPossiblyRemove ) && !typeToPossiblyRemove.getAllTypesInHierarchy().contains( otherType ) ) { outerIterator.remove(); break; } } } }
private static void pruneNonLUBs( Set<IType> typeSet ) { for( Iterator<IType> outerIterator = typeSet.iterator(); outerIterator.hasNext(); ) { IType typeToPossiblyRemove = outerIterator.next(); for( IType otherType : typeSet ) { //noinspection SuspiciousMethodCalls if( otherType.getAllTypesInHierarchy().contains( typeToPossiblyRemove ) && !typeToPossiblyRemove.getAllTypesInHierarchy().contains( otherType ) ) { outerIterator.remove(); break; } } } }
public boolean isAssignableFrom(IType type) { //noinspection SuspiciousMethodCalls return type.getAllTypesInHierarchy().contains( TypeSystem.getOrCreateTypeReference( this ) ); }
public boolean isAssignableFrom(IType type) { //noinspection SuspiciousMethodCalls return type.getAllTypesInHierarchy().contains( TypeSystem.getOrCreateTypeReference( this ) ); }
public int addDegreesOfSeparation( IType parameterType, IType exprType, List<IType> inferringTypes ) { return addDegreesOfSeparation( parameterType, exprType instanceof IInvocableType ? Collections.singleton( exprType ) : exprType.getAllTypesInHierarchy(), inferringTypes ); }
public GosuFragment(String name, HashMap<String, ISymbol> externalSymbols, ITypeUsesMap typeUsesMap) { _typeInfo = createTypeInfo(); _typeUsesMap = typeUsesMap; _name = name; _externalSymbols = externalSymbols; _supertype = JavaTypes.FRAGMENT_INSTANCE(); _allTypesInHierarchy = new HashSet<IType>(); _allTypesInHierarchy.addAll(_supertype.getAllTypesInHierarchy()); _allTypesInHierarchy.add(this); }
public GosuFragment(String name, HashMap<String, ISymbol> externalSymbols, ITypeUsesMap typeUsesMap) { _typeInfo = createTypeInfo(); _typeUsesMap = typeUsesMap; _name = name; _externalSymbols = externalSymbols; _supertype = JavaTypes.FRAGMENT_INSTANCE(); _allTypesInHierarchy = new HashSet<IType>(); _allTypesInHierarchy.addAll(_supertype.getAllTypesInHierarchy()); _allTypesInHierarchy.add(this); }
public Set<IType> getAllTypesInHierarchy() { //noinspection unchecked return (Set<IType>)(getBoundingType() == null ? Collections.emptySet() : getBoundingType().getAllTypesInHierarchy()); }
public Set<IType> getAllTypesInHierarchy() { //noinspection unchecked return (Set<IType>)(getBoundingType() == null ? Collections.emptySet() : getBoundingType().getAllTypesInHierarchy()); }
/** */ public boolean isAssignableFrom( IType type ) { return type.getAllTypesInHierarchy().contains( getThisRef() ) || (type.isArray() && type.getClass().isInstance( getThisRef() ) && this.getComponentType().isAssignableFrom( type.getComponentType() )); }
/** */ public boolean isAssignableFrom( IType type ) { return type.getAllTypesInHierarchy().contains( getThisRef() ) || (type.isArray() && type.getClass().isInstance( getThisRef() ) && this.getComponentType().isAssignableFrom( type.getComponentType() )); }
@Override public Set<? extends IType> getAllTypesInHierarchy() { if( _allTypesInHierarchy == null ) { //noinspection unchecked,RedundantCast IType type = TypeSystem.get(getType().getClass(), TypeSystem.getGlobalModule()); Set<IType> types = getTypeInterfaces(type, new HashSet<IType>()); for( IType t: getType().getAllTypesInHierarchy() ) { types.add( MetaType.get( t ) ); } _allTypesInHierarchy = types; } return _allTypesInHierarchy; }
protected Set<? extends IType> loadAllTypesInHierarchy() { Set<IType> allTypes; if( isArray() ) { allTypes = getArrayVersionsOfEachType( getComponentType().getAllTypesInHierarchy() ); } else { allTypes = getAllClassesInClassHierarchyAsIntrinsicTypes( TypeSystem.getOrCreateTypeReference( this ) ); } return allTypes; }
protected Set<? extends IType> loadAllTypesInHierarchy() { Set<IType> allTypes; if( isArray() ) { allTypes = getArrayVersionsOfEachType( getComponentType().getAllTypesInHierarchy() ); } else { allTypes = getAllClassesInClassHierarchyAsIntrinsicTypes( TypeSystem.getOrCreateTypeReference( this ) ); } return allTypes; }
public IType getComponentType(IType valueType) { IType componentType; if (valueType.isArray()) { componentType = valueType.getComponentType(); } else if (valueType instanceof IPlaceholder && ((IPlaceholder) valueType).isPlaceholder()) { componentType = valueType.getComponentType(); } else { IType qrsType = JavaTypes.IQUERY_RESULT_SET(); if (qrsType.isAssignableFrom(valueType)) { for (IType iType : valueType.getAllTypesInHierarchy()) { if (iType.isParameterizedType() && iType.getGenericType().equals(qrsType)) { return iType.getTypeParameters()[0]; } } componentType = ErrorType.getInstance(); } else { componentType = ErrorType.getInstance(); } } return componentType; }