Add calendars to the tree.

@param parentNode parent tree node
@param file calendar container
175739
private void addCalendars(MpxjTreeNode parentNode, ProjectFile file)
   {
      for (ProjectCalendar calendar : file.getCalendars())
      {
         addCalendar(parentNode, calendar);
      }
   }
1313827
public void setParent(AstNode parent) {
        if (parent == this.parent) {
            return;
        }

        // Convert position back to absolute.
        if (this.parent != null) {
            setRelative(-this.parent.getAbsolutePosition());
        }

        this.parent = parent;
        if (parent != null) {
            setRelative(parent.getAbsolutePosition());
        }
    }
997084
private function addSkipped(ParentNode $parent) {
    $parent->addChildren($this->getSkipNodes($this->skipped));
    $this->skipped = [];
    $this->matchDocComment($this->skipParent ?: $parent, NULL);
    $this->skipParent = NULL;
  }
894358
INodeDirectory addToParent( byte[] src,
                              INodeDirectory parentINode,
                              INode newNode,
                              boolean propagateModTime,
                              int childIndex) {
    // NOTE: This does not update space counts for parents
    // add new node to the parent
    INodeDirectory newParent = null;
    writeLock();
    try {
      try {
        newParent = rootDir.addToParent(src, newNode, parentINode,
                                            false, propagateModTime, childIndex);
        cacheName(newNode);
      } catch (FileNotFoundException e) {
        return null;
      }
      if(newParent == null)
        return null;
      if(!newNode.isDirectory()) {
        // Add block->file mapping
        INodeFile newF = (INodeFile)newNode;
        BlockInfo[] blocks = newF.getBlocks();
        for (int i = 0; i < blocks.length; i++) {
          newF.setBlock(i, getFSNamesystem().blocksMap.addINodeForLoading(blocks[i], newF));
        }
      }
    } finally {
      writeUnlock();
    }
    return newParent;
  }
1195309
protected function addParentAndAncestors($node, &$doc)
    {
        $parent = $node->getParent();

        if ($parent) {
            $doc['parent'] = $parent->getId();
            $ancestors = [];
            do {
                $ancestors[] = $parent->getId();
                $parent = $parent->getParent();
            } while ($parent);
            $doc['ancestors'] = $ancestors;
        }
    }
271382
public static <T extends HierarchyEntity<T, ?>> void addParent(Collection<T> nodes) {
    addParent(nodes, null);
  }
342268
public void add(Date date) {
    final Calendar cal = Calendar.getInstance();
    cal.setTime(date);
    add(cal);
    date.setTime(cal.getTime().getTime());
  }
1184339
function update_parent_node_data(error) {
    if(error) {
      callback(error);
    } else {
      parentNodeData[name] = new DirectoryEntry(node.id, type);
      context.putObject(parentNode.data, parentNodeData, update_time);
    }
  }
947336
function isParent(node, file){
	while (node && node.parent && node.file) {
		if (node.file == file) {
			return true;
		}
		node = node.parent;
	}
	return false;
}
1182207
private void addGroups(MpxjTreeNode parentNode, ProjectFile file)
   {
      for (Group group : file.getGroups())
      {
         final Group g = group;
         MpxjTreeNode childNode = new MpxjTreeNode(group)
         {
            @Override public String toString()
            {
               return g.getName();
            }
         };
         parentNode.add(childNode);
      }
   }
740289
public static void createParentDirectories(File file) {
		File parent = file.getParentFile();
		if (!parent.isDirectory()) {
			// Test the creation separately as there appears to be a race
			// condition that causes unit tests to sometimes fail.
			boolean created = parent.mkdirs();
			if (!created && !parent.isDirectory()) {
				throw new SystemException(MessageUtils.format(
						MSG_CANNOT_CREATE_OUTPUT_DIRECTORY,
						parent.getAbsolutePath()), parent);
			}
		}

	}
570627
private void setParent(DepTreeNode parent) {
		if (this.name.length() == 0) {
			// A child node must have a name.
			throw new IllegalStateException();
		}
		this.parent = new WeakReference<DepTreeNode>(parent);
	}
962703
public static <T extends MutableTreeNode<T>> void addChild(T parent, T child) {
        checkArgNotNull(parent, "parent");
        parent.addChild(parent.getChildren().size(), child);
    }
254028
protected final void setParentNode(final DiffNode parentNode)
	{
		if (this.parentNode != null && this.parentNode != parentNode)
		{
			throw new IllegalStateException("The parent of a node cannot be changed, once it's set.");
		}
		this.parentNode = parentNode;
	}
59090
@Override
  public void initializeFromFile(TreeIndexHeader header, PageFile<FlatRStarTreeNode> file) {
    super.initializeFromFile(header, file);

    // reconstruct root
    int nextPageID = file.getNextPageID();
    dirCapacity = nextPageID;
    root = createNewDirectoryNode();
    for(int i = 1; i < nextPageID; i++) {
      FlatRStarTreeNode node = getNode(i);
      root.addDirectoryEntry(createNewDirectoryEntry(node));
    }

    if(LOG.isDebugging()) {
      LOG.debugFine("root: " + root + " with " + nextPageID + " leafNodes.");
    }
  }
1006529
protected void addParentKeyToDocument(String parentId, Document currentDoc, Class<?> clazz) {
        // if (parentId != null)
        if (clazz != null && parentId != null) {
            Field luceneField =
                new Field(IndexingConstants.PARENT_ID_FIELD, parentId, Field.Store.YES, Field.Index.ANALYZED_NO_NORMS);
            currentDoc.add(luceneField);
            Field fieldClass =
                new Field(IndexingConstants.PARENT_ID_CLASS, clazz.getCanonicalName().toLowerCase(), Field.Store.YES,
                    Field.Index.ANALYZED);
            currentDoc.add(fieldClass);
        }
    }
845690
private void writeCalendarException(ProjectCalendar parentCalendar, ProjectCalendarException record) throws IOException
   {
      m_buffer.setLength(0);

      if (!parentCalendar.isDerived())
      {
         m_buffer.append(MPXConstants.BASE_CALENDAR_EXCEPTION_RECORD_NUMBER);
      }
      else
      {
         m_buffer.append(MPXConstants.RESOURCE_CALENDAR_EXCEPTION_RECORD_NUMBER);
      }
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatDate(record.getFromDate())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatDate(record.getToDate())));
      m_buffer.append(m_delimiter);
      m_buffer.append(record.getWorking() ? "1" : "0");
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatTime(record.getRange(0).getStart())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatTime(record.getRange(0).getEnd())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatTime(record.getRange(1).getStart())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatTime(record.getRange(1).getEnd())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatTime(record.getRange(2).getStart())));
      m_buffer.append(m_delimiter);
      m_buffer.append(format(formatTime(record.getRange(2).getEnd())));
      stripTrailingDelimiters(m_buffer);
      m_buffer.append(MPXConstants.EOL);

      m_writer.write(m_buffer.toString());
   }