本文整理汇总了Java中org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.ArrayType.getDimensions方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayType.getDimensions方法的具体用法?Java ArrayType.getDimensions怎么用?Java ArrayType.getDimensions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.ArrayType
的用法示例。
在下文中一共展示了ArrayType.getDimensions方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: enumerate
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.ArrayType; //导入方法依赖的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;
}
示例2: enumerate
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.ArrayType; //导入方法依赖的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;
}
示例3: enumerate
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.ArrayType; //导入方法依赖的package包/类
@Override
public EnumeratedTypeSet enumerate() {
if (fEnumCache == null) {
fEnumCache= new EnumeratedTypeSet(getTypeSetEnvironment());
boolean anyLBIsIntfOrArray= false;
for(Iterator<TType> iter= fLowerBounds.iterator(); iter.hasNext(); ) {
TType lb= iter.next();
if (lb instanceof ArrayType) {
ArrayType at= (ArrayType) lb;
int numDims= at.getDimensions();
for(Iterator<TType> elemSuperIter=TTypes.getAllSuperTypesIterator(at.getElementType()); elemSuperIter.hasNext(); )
fEnumCache.add(TTypes.createArrayType(elemSuperIter.next(), numDims));
anyLBIsIntfOrArray= true;
} else {
for (Iterator<TType> iterator= TTypes.getAllSuperTypesIterator(lb); iterator.hasNext(); )
fEnumCache.fMembers.add(iterator.next());
}
fEnumCache.add(lb);
}
if (anyLBIsIntfOrArray) fEnumCache.add(getJavaLangObject());
//fEnumCache.initComplete();
}
return fEnumCache;
}
示例4: enumerate
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.ArrayType; //导入方法依赖的package包/类
@Override
public EnumeratedTypeSet enumerate() {
if (fEnumCache == null) {
fEnumCache = new EnumeratedTypeSet(getTypeSetEnvironment());
boolean anyLBIsIntfOrArray = false;
for (Iterator<TType> iter = fLowerBounds.iterator(); iter.hasNext(); ) {
TType lb = iter.next();
if (lb instanceof ArrayType) {
ArrayType at = (ArrayType) lb;
int numDims = at.getDimensions();
for (Iterator<TType> elemSuperIter = TTypes.getAllSuperTypesIterator(at.getElementType());
elemSuperIter.hasNext(); )
fEnumCache.add(TTypes.createArrayType(elemSuperIter.next(), numDims));
anyLBIsIntfOrArray = true;
} else {
for (Iterator<TType> iterator = TTypes.getAllSuperTypesIterator(lb); iterator.hasNext(); )
fEnumCache.fMembers.add(iterator.next());
}
fEnumCache.add(lb);
}
if (anyLBIsIntfOrArray) fEnumCache.add(getJavaLangObject());
// fEnumCache.initComplete();
}
return fEnumCache;
}
示例5: upperBound
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.ArrayType; //导入方法依赖的package包/类
@Override
public TypeSet upperBound() {
if (fMembers.size() == 1)
return new SingletonTypeSet(fMembers.iterator().next(), getTypeSetEnvironment());
if (fMembers.contains(getJavaLangObject()))
return new SingletonTypeSet(getJavaLangObject(), getTypeSetEnvironment());
EnumeratedTypeSet result = new EnumeratedTypeSet(getTypeSetEnvironment());
// Add to result each element of fMembers that has no proper supertype in fMembers
result.fMembers.addAll(fMembers);
for (Iterator<TType> iter = fMembers.iterator(); iter.hasNext(); ) {
TType t = iter.next();
if (t.isArrayType()) {
ArrayType at = (ArrayType) t;
int numDims = at.getDimensions();
for (Iterator<TType> subIter = TTypes.getAllSubTypesIterator(at.getElementType());
subIter.hasNext(); ) {
result.fMembers.remove(TTypes.createArrayType(subIter.next(), numDims));
}
} else {
for (Iterator<TType> iterator = TTypes.getAllSubTypesIterator(t); iterator.hasNext(); ) {
result.fMembers.remove(iterator.next());
}
}
}
result.initComplete();
return result;
}
示例6: lowerBound
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.ArrayType; //导入方法依赖的package包/类
@Override
public TypeSet lowerBound() {
if (fMembers.size() == 1)
return new SingletonTypeSet(fMembers.iterator().next(), getTypeSetEnvironment());
EnumeratedTypeSet result = new EnumeratedTypeSet(getTypeSetEnvironment());
// Add to result each element of fMembers that has no proper subtype in fMembers
result.fMembers.addAll(fMembers);
for (Iterator<TType> iter = fMembers.iterator(); iter.hasNext(); ) {
TType t = iter.next();
// java.lang.Object is only in the lower bound if fMembers consists
// of only java.lang.Object, but that case is handled above.
if (t.equals(getJavaLangObject())) {
result.fMembers.remove(t);
continue;
}
if (t instanceof ArrayType) {
ArrayType at = (ArrayType) t;
int numDims = at.getDimensions();
for (Iterator<TType> superIter = TTypes.getAllSuperTypesIterator(at.getElementType());
superIter.hasNext(); ) {
result.fMembers.remove(TTypes.createArrayType(superIter.next(), numDims));
}
} else {
for (Iterator<TType> iterator = TTypes.getAllSuperTypesIterator(t); iterator.hasNext(); ) {
result.fMembers.remove(iterator.next());
}
}
}
if (result.size() > 0) return result;
else return getTypeSetEnvironment().getEmptyTypeSet();
}
示例7: upperBound
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.ArrayType; //导入方法依赖的package包/类
@Override
public TypeSet upperBound() {
if (fMembers.size() == 1)
return new SingletonTypeSet(fMembers.iterator().next(), getTypeSetEnvironment());
if (fMembers.contains(getJavaLangObject()))
return new SingletonTypeSet(getJavaLangObject(), getTypeSetEnvironment());
EnumeratedTypeSet result= new EnumeratedTypeSet(getTypeSetEnvironment());
// Add to result each element of fMembers that has no proper supertype in fMembers
result.fMembers.addAll(fMembers);
for(Iterator<TType> iter= fMembers.iterator(); iter.hasNext(); ) {
TType t= iter.next();
if (t.isArrayType()) {
ArrayType at= (ArrayType) t;
int numDims= at.getDimensions();
for(Iterator<TType> subIter=TTypes.getAllSubTypesIterator(at.getElementType()); subIter.hasNext(); ) {
result.fMembers.remove(TTypes.createArrayType(subIter.next(), numDims));
}
} else {
for (Iterator<TType> iterator= TTypes.getAllSubTypesIterator(t); iterator.hasNext();) {
result.fMembers.remove(iterator.next());
}
}
}
result.initComplete();
return result;
}
示例8: lowerBound
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.ArrayType; //导入方法依赖的package包/类
@Override
public TypeSet lowerBound() {
if (fMembers.size() == 1)
return new SingletonTypeSet(fMembers.iterator().next(), getTypeSetEnvironment());
EnumeratedTypeSet result= new EnumeratedTypeSet(getTypeSetEnvironment());
// Add to result each element of fMembers that has no proper subtype in fMembers
result.fMembers.addAll(fMembers);
for(Iterator<TType> iter= fMembers.iterator(); iter.hasNext(); ) {
TType t= iter.next();
// java.lang.Object is only in the lower bound if fMembers consists
// of only java.lang.Object, but that case is handled above.
if (t.equals(getJavaLangObject())) {
result.fMembers.remove(t);
continue;
}
if (t instanceof ArrayType) {
ArrayType at= (ArrayType) t;
int numDims= at.getDimensions();
for(Iterator<TType> superIter=TTypes.getAllSuperTypesIterator(at.getElementType()); superIter.hasNext(); ) {
result.fMembers.remove(TTypes.createArrayType(superIter.next(), numDims));
}
} else {
for (Iterator<TType> iterator= TTypes.getAllSuperTypesIterator(t); iterator.hasNext();) {
result.fMembers.remove(iterator.next());
}
}
}
if (result.size() > 0)
return result;
else
return getTypeSetEnvironment().getEmptyTypeSet();
}