Esempio n. 1
0
  private int getSumChildrenSize() {
    int nNbOccurs = getNbOccurs();

    int nSingleItemSize = getSingleItemRequiredStorageSize();
    int nSumChildrenSize = 0;
    if (isVarDefForm()) nSumChildrenSize = getHeaderLength();

    if (m_arrChildren != null) {
      int nNbChildren = m_arrChildren.size();
      for (int nChild = 0; nChild < nNbChildren; nChild++) {
        VarDefBase varDefChild = getChild(nChild);
        int nSize = varDefChild.calcSize();
        if (varDefChild.m_varDefRedefinOrigin == null || varDefChild.isEditInMapRedefine())
          nSumChildrenSize += nSize;
        else if (isVarInMapRedefine() && !m_varDefParent.isEditInMapRedefine())
          nSumChildrenSize += nSize;
      }
    }

    if (nSingleItemSize == 0) // We have no size defined for ourself
    {
      if (isEditInMapRedefine() && m_OccursDef != null) return nNbOccurs * nSumChildrenSize;
      if (m_varDefRedefinOrigin != null) // We are a redefine
      {
        int n = m_varDefRedefinOrigin.getTotalSize();
        return n; // do not count the number of occurances, because
      }
      return nNbOccurs * nSumChildrenSize;
    }
    return nNbOccurs * nSingleItemSize;
  }
Esempio n. 2
0
 int getNbItems() {
   int nNbOccurs = getNbOccurs();
   if (m_arrChildren != null) {
     int n = 0;
     for (int nChild = 0; nChild < m_arrChildren.size(); nChild++) {
       VarDefBase varDefChild = getChild(nChild);
       if (varDefChild != null && varDefChild.isEditInMapRedefine()) n += varDefChild.getNbItems();
     }
     if (n == 0) n = 1;
     return nNbOccurs * n;
   } else return nNbOccurs;
 }
Esempio n. 3
0
 private VarDefBase getPreviousSameLevelNonRedefine(
     SharedProgramInstanceData sharedProgramInstanceData) {
   if (getVarDefPreviousSameLevel(sharedProgramInstanceData) != null) {
     VarDefBase varDefPrevious = getVarDefPreviousSameLevel(sharedProgramInstanceData);
     if (varDefPrevious.m_varDefRedefinOrigin != null) // The previous is a redefine
     {
       if (varDefPrevious
           .isEditInMapRedefine()) // PJD: previous sibling determination error correction
       return varDefPrevious; // PJD: previous sibling determination error correction
       return varDefPrevious.getPreviousSameLevelNonRedefine(sharedProgramInstanceData);
     }
     return varDefPrevious; // the previous is not a redefine
   }
   return null; // No previous at the same level
 }