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


Java ArrayType.getDimensions方法代码示例

本文整理汇总了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;
}
 
开发者ID:eclipse,项目名称:che,代码行数:26,代码来源:SubTypesSet.java

示例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;
	}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:25,代码来源:SubTypesSet.java

示例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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:27,代码来源:SuperTypesSet.java

示例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;
}
 
开发者ID:eclipse,项目名称:che,代码行数:28,代码来源:SuperTypesSet.java

示例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;
}
 
开发者ID:eclipse,项目名称:che,代码行数:31,代码来源:EnumeratedTypeSet.java

示例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();
}
 
开发者ID:eclipse,项目名称:che,代码行数:37,代码来源:EnumeratedTypeSet.java

示例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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:30,代码来源:EnumeratedTypeSet.java

示例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();
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:38,代码来源:EnumeratedTypeSet.java


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