本文整理汇总了Java中org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.TTypes类的典型用法代码示例。如果您正苦于以下问题:Java TTypes类的具体用法?Java TTypes怎么用?Java TTypes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TTypes类属于org.eclipse.jdt.internal.corext.refactoring.typeconstraints2包,在下文中一共展示了TTypes类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: contains
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.TTypes; //导入依赖的package包/类
@Override
public boolean contains(TType t) {
if (t.equals(getJavaLangObject())) return true;
if (!(t instanceof ArrayType)) return false;
ArrayType at = (ArrayType) t;
TType atElemType = at.getComponentType();
if (fElemTypeSet.contains(atElemType)) // try to avoid enumeration
return true;
for (Iterator<TType> iter = fElemTypeSet.iterator(); iter.hasNext(); ) {
TType elemType = iter.next();
if (TTypes.canAssignTo(elemType, atElemType)) return true;
}
return false;
}
示例2: enumerate
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.TTypes; //导入依赖的package包/类
@Override
public EnumeratedTypeSet enumerate() {
if (fEnumCache == null) {
fEnumCache = new EnumeratedTypeSet(getTypeSetEnvironment());
TypeSet elemSupers = fElemTypeSet.superTypes();
for (Iterator<TType> iter = elemSupers.iterator(); iter.hasNext(); ) {
TType elemSuper = iter.next();
fEnumCache.add(TTypes.createArrayType(elemSuper, 1));
}
fEnumCache.add(getJavaLangObject());
fEnumCache.initComplete();
}
return fEnumCache;
}
示例3: enumerate
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.TTypes; //导入依赖的package包/类
@Override
public EnumeratedTypeSet enumerate() {
if (fEnumCache == null) {
if (fLowerBound instanceof ArrayType) {
ArrayType at = (ArrayType) fLowerBound;
fEnumCache =
EnumeratedTypeSet.makeArrayTypesForElements(
TTypes.getAllSuperTypesIterator(at.getComponentType()), getTypeSetEnvironment());
fEnumCache.add(getJavaLangObject());
} else
fEnumCache =
new EnumeratedTypeSet(
TTypes.getAllSuperTypesIterator(fLowerBound), getTypeSetEnvironment());
fEnumCache.add(fLowerBound);
fEnumCache.initComplete();
}
return fEnumCache;
}
示例4: lowerBound
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.TTypes; //导入依赖的package包/类
@Override
public TypeSet lowerBound() {
if (fLHS.hasUniqueLowerBound() && fRHS.hasUniqueLowerBound()) {
TType lhsBound = fLHS.uniqueLowerBound();
TType rhsBound = fRHS.uniqueLowerBound();
if (lhsBound.equals(rhsBound)) return new SingletonTypeSet(lhsBound, getTypeSetEnvironment());
else if (TTypes.canAssignTo(lhsBound, rhsBound))
return new SingletonTypeSet(rhsBound, getTypeSetEnvironment());
else if (TTypes.canAssignTo(rhsBound, lhsBound))
return new SingletonTypeSet(lhsBound, getTypeSetEnvironment());
}
if (fEnumCache != null) return fEnumCache.lowerBound();
EnumeratedTypeSet lhsSet = fLHS.enumerate();
EnumeratedTypeSet rhsSet = fRHS.enumerate();
TypeSet xsect = lhsSet.intersectedWith(rhsSet);
return xsect.lowerBound();
}
示例5: contains
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.TTypes; //导入依赖的package包/类
@Override
public boolean contains(TType t) {
if (fEnumCache != null) return fEnumCache.contains(t);
if (fUpperBounds.contains(t)) return true;
// Find the "upper frontier", i.e. the upper bound, and see whether
// the given type is a subtype of any of those.
Iterator<TType> ubIter = fUpperBounds.upperBound().iterator();
for (; ubIter.hasNext(); ) {
TType ub = ubIter.next();
if (TTypes.canAssignTo(t, ub)) return true;
}
return false;
}
示例6: containsAll
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.TTypes; //导入依赖的package包/类
@Override
public boolean containsAll(TypeSet s) {
if (fEnumCache != null) return fEnumCache.containsAll(s);
if (fUpperBounds.containsAll(s)) return true;
// Make sure all elements of s are contained in this set
for (Iterator<TType> sIter = s.iterator(); sIter.hasNext(); ) {
TType t = sIter.next();
boolean found = false;
// Scan the "upper frontier", i.e. the upper bound set, and see whether
// 't' is a subtype of any of those.
for (Iterator<TType> ubIter = fUpperBounds /*.upperBound() */.iterator();
ubIter.hasNext(); ) {
TType ub = ubIter.next();
if (TTypes.canAssignTo(t, ub)) {
found = true;
break;
}
}
if (!found) return false;
}
return true;
}
示例7: enumerate
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.TTypes; //导入依赖的package包/类
@Override
public EnumeratedTypeSet enumerate() {
if (fEnumCache == null) {
fEnumCache = new EnumeratedTypeSet(getTypeSetEnvironment());
for (Iterator<TType> iter = fUpperBounds.iterator(); iter.hasNext(); ) {
TType ub = iter.next();
if (ub instanceof ArrayType) {
ArrayType at = (ArrayType) ub;
int numDims = at.getDimensions();
for (Iterator<TType> elemSubIter = TTypes.getAllSubTypesIterator(at.getElementType());
elemSubIter.hasNext(); )
fEnumCache.add(TTypes.createArrayType(elemSubIter.next(), numDims));
} else {
for (Iterator<TType> iterator = TTypes.getAllSubTypesIterator(ub); iterator.hasNext(); ) {
fEnumCache.fMembers.add(iterator.next());
}
}
fEnumCache.add(ub);
}
// fEnumCache.initComplete();
}
return fEnumCache;
}
示例8: enumerate
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.TTypes; //导入依赖的package包/类
@Override
public EnumeratedTypeSet enumerate() {
if (fEnumCache == null) {
if (fUpperBound instanceof ArrayType) {
ArrayType at = (ArrayType) fUpperBound;
fEnumCache =
EnumeratedTypeSet.makeArrayTypesForElements(
TTypes.getAllSubTypesIterator(at.getComponentType()), getTypeSetEnvironment());
} else
fEnumCache =
new EnumeratedTypeSet(
TTypes.getAllSubTypesIterator(fUpperBound), getTypeSetEnvironment());
fEnumCache.add(fUpperBound);
fEnumCache.initComplete();
}
return fEnumCache;
}
示例9: iterator
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.TTypes; //导入依赖的package包/类
@Override
public Iterator<TType> iterator() {
if (fEnumCache != null) return fEnumCache.iterator();
return new Iterator<TType>() {
Iterator<TType> fElemIter = fElemTypeSet.iterator();
public boolean hasNext() {
return fElemIter.hasNext();
}
public TType next() {
return TTypes.createArrayType(fElemIter.next(), 1);
}
public void remove() {
throw new UnsupportedOperationException();
}
};
}
示例10: contains
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.TTypes; //导入依赖的package包/类
@Override
public boolean contains(TType t) {
if (fEnumCache != null) return fEnumCache.contains(t);
if (t.equals(getJavaLangObject())) return true;
if (fLowerBounds.contains(t)) return true;
// Find the "lower frontier", i.e. the lower bound, and see whether
// the given type is a supertype of any of those.
for (Iterator<TType> lbIter = fLowerBounds /*.lowerBound() */.iterator(); lbIter.hasNext(); ) {
TType lb = lbIter.next();
if (TTypes.canAssignTo(lb, t)) return true;
}
return false;
}
示例11: contains
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.TTypes; //导入依赖的package包/类
@Override
public boolean contains(TType t) {
if (t.equals(getJavaLangObject())) return true;
if (!(t instanceof ArrayType))
return false;
ArrayType at= (ArrayType) t;
TType atElemType= at.getComponentType();
if (fElemTypeSet.contains(atElemType)) // try to avoid enumeration
return true;
for(Iterator<TType> iter= fElemTypeSet.iterator(); iter.hasNext(); ) {
TType elemType= iter.next();
if (TTypes.canAssignTo(elemType, atElemType))
return true;
}
return false;
}
示例12: enumerate
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.TTypes; //导入依赖的package包/类
@Override
public EnumeratedTypeSet enumerate() {
if (fEnumCache == null) {
fEnumCache= new EnumeratedTypeSet(getTypeSetEnvironment());
TypeSet elemSupers= fElemTypeSet.superTypes();
for(Iterator<TType> iter= elemSupers.iterator(); iter.hasNext(); ) {
TType elemSuper= iter.next();
fEnumCache.add(TTypes.createArrayType(elemSuper, 1));
}
fEnumCache.add(getJavaLangObject());
fEnumCache.initComplete();
}
return fEnumCache;
}
示例13: lowerBound
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.TTypes; //导入依赖的package包/类
@Override
public TypeSet lowerBound() {
if (fLHS.hasUniqueLowerBound() && fRHS.hasUniqueLowerBound()) {
TType lhsBound= fLHS.uniqueLowerBound();
TType rhsBound= fRHS.uniqueLowerBound();
if (lhsBound.equals(rhsBound))
return new SingletonTypeSet(lhsBound, getTypeSetEnvironment());
else if (TTypes.canAssignTo(lhsBound, rhsBound))
return new SingletonTypeSet(rhsBound, getTypeSetEnvironment());
else if (TTypes.canAssignTo(rhsBound, lhsBound))
return new SingletonTypeSet(lhsBound, getTypeSetEnvironment());
}
if (fEnumCache != null) return fEnumCache.lowerBound();
EnumeratedTypeSet lhsSet= fLHS.enumerate();
EnumeratedTypeSet rhsSet= fRHS.enumerate();
TypeSet xsect= lhsSet.intersectedWith(rhsSet);
return xsect.lowerBound();
}
示例14: contains
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.TTypes; //导入依赖的package包/类
@Override
public boolean contains(TType t) {
if (fEnumCache != null) return fEnumCache.contains(t);
if (fUpperBounds.contains(t))
return true;
// Find the "upper frontier", i.e. the upper bound, and see whether
// the given type is a subtype of any of those.
Iterator<TType> ubIter= fUpperBounds.upperBound().iterator();
for(; ubIter.hasNext(); ) {
TType ub= ubIter.next();
if (TTypes.canAssignTo(t, ub))
return true;
}
return false;
}
示例15: containsAll
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.TTypes; //导入依赖的package包/类
@Override
public boolean containsAll(TypeSet s) {
if (fEnumCache != null) return fEnumCache.containsAll(s);
if (fUpperBounds.containsAll(s))
return true;
// Make sure all elements of s are contained in this set
for(Iterator<TType> sIter= s.iterator(); sIter.hasNext(); ) {
TType t= sIter.next();
boolean found= false;
// Scan the "upper frontier", i.e. the upper bound set, and see whether
// 't' is a subtype of any of those.
for(Iterator<TType> ubIter= fUpperBounds /*.upperBound() */.iterator(); ubIter.hasNext(); ) {
TType ub= ubIter.next();
if (TTypes.canAssignTo(t, ub)) {
found= true;
break;
}
}
if (!found) return false;
}
return true;
}