Ejemplo n.º 1
0
 public void getChildrenEncodingConvertiblePosition(
     VarDefEncodingConvertibleManager varDefEncodingConvertibleManager) {
   if (m_arrChildren != null) {
     int nNbChildren = m_arrChildren.size();
     for (int nChild = 0; nChild < nNbChildren; nChild++) {
       VarDefBase varDefChild = getChild(nChild);
       if (!varDefChild.isARedefine())
         varDefChild.getChildrenEncodingConvertiblePosition(varDefEncodingConvertibleManager);
     }
   } else // No child: We are a final node
   {
     if (!isARedefine() && isEbcdicAsciiConvertible()) {
       int nNbDim = getNbDim();
       if (nNbDim == 0) varDefEncodingConvertibleManager.add(this);
       else if (nNbDim == 1) {
         TempCache cache = TempCacheLocator.getTLSTempCache();
         int nNbX = getMaxIndexAtDim(0);
         for (int x = 0; x < nNbX; x++) {
           VarDefBuffer varDefItem = getCachedGetAt(cache, x + 1);
           if (varDefItem != null) varDefEncodingConvertibleManager.add(varDefItem);
           cache.resetTempVarIndex(varDefItem.getTypeId());
         }
       } else if (nNbDim == 2) {
         TempCache cache = TempCacheLocator.getTLSTempCache();
         int nNbY = getMaxIndexAtDim(1);
         int nNbX = getMaxIndexAtDim(0);
         for (int y = 0; y < nNbY; y++) {
           for (int x = 0; x < nNbX; x++) {
             VarDefBuffer varDefItem = getCachedGetAt(cache, y + 1, x + 1);
             if (varDefItem != null) varDefEncodingConvertibleManager.add(varDefItem);
             cache.resetTempVarIndex(varDefItem.getTypeId());
           }
         }
       } else if (nNbDim == 3) {
         TempCache cache = TempCacheLocator.getTLSTempCache();
         int nNbZ = getMaxIndexAtDim(2);
         int nNbY = getMaxIndexAtDim(1);
         int nNbX = getMaxIndexAtDim(0);
         for (int z = 0; z < nNbZ; z++) {
           for (int y = 0; y < nNbY; y++) {
             for (int x = 0; x < nNbX; x++) {
               VarDefBuffer varDefItem = getCachedGetAt(cache, z + 1, y + 1, x + 1);
               if (varDefItem != null) varDefEncodingConvertibleManager.add(varDefItem);
               cache.resetTempVarIndex(varDefItem.getTypeId());
             }
           }
         }
       }
     }
   }
 }