| /******************************************************************************* |
| * Copyright (c) 2005, 2016 IBM Corporation and others. |
| * This program and the accompanying materials are made available under the |
| * terms of the Eclipse Public License v. 2.0 which is available at |
| * http://www.eclipse.org/legal/epl-2.0. |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| *******************************************************************************/ |
| package org.eclipse.dltk.python.internal.core.evaluation.types; |
| |
| import org.eclipse.dltk.core.IModule; |
| import org.eclipse.dltk.ti.types.IEvaluatedType; |
| |
| public class ImportedType implements IEvaluatedType |
| { |
| private IModule fModule = null; |
| private IEvaluatedType fType = null; |
| public ImportedType( IEvaluatedType type, IModule module ) { |
| |
| this.fType = type; |
| this.fModule = module; |
| } |
| |
| |
| @Override |
| public boolean equals( Object obj ) { |
| |
| if( obj instanceof ImportedType ) { |
| ImportedType o2 = (ImportedType)obj; |
| if( this.fModule != null && this.fModule.equals( o2.getModule() ) ) { |
| if( this.fType != null && this.fType.equals( o2.getType() ) ) { |
| return true; |
| } |
| } |
| } |
| return false; |
| } |
| public IModule getModule() { |
| return this.fModule; |
| } |
| public IEvaluatedType getType() { |
| return this.fType; |
| } |
| |
| @Override |
| public String getTypeName() |
| { |
| if( this.fType != null && this.fModule != null ) { |
| return this.fType.getTypeName(); |
| } |
| else { |
| return "imported type"; |
| } |
| } |
| |
| |
| @Override |
| public boolean subtypeOf(IEvaluatedType type) { |
| // TODO Auto-generated method stub |
| return false; |
| } |
| } |