blob: 50a4cc47838f8a0eebf984a87ed42a6c0727f8a9 [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
using System;
using System.Collections.Generic;
using Thrift;
namespace Apache.IoTDB
{
public class InternalNode : TemplateNode
{
private Dictionary<string, TemplateNode> children;
private bool shareTime;
public InternalNode(string name, bool shareTime) : base(name)
{
this.children = new Dictionary<string, TemplateNode>();
this.shareTime = shareTime;
}
public override void addChild(TemplateNode node)
{
if (this.children.ContainsKey(node.Name))
{
throw new Exception("Duplicated child of node in template.");
}
this.children.Add(node.Name, node);
}
public override void deleteChild(TemplateNode node)
{
if (this.children.ContainsKey(node.Name))
{
this.children.Remove(node.Name);
}
}
public override Dictionary<string, TemplateNode> getChildren()
{
return this.children;
}
public override bool isShareTime()
{
return this.shareTime;
}
}
}