⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 graphdatacollection.cs

📁 英语句子自然语言处理统计分析例子 Statistical parsing of English sentences Shows how to generate parse trees for
💻 CS
字号:
using System;

namespace Netron.Lithium
{
	/// <summary>
	/// Generic Collectioon of GraphML related data
	/// </summary>
	public class GraphDataCollection : System.Collections.CollectionBase 
	{
    
		#region Properties
		/// <summary>
		/// integer indexer
		/// </summary>
		public virtual object this[int index] 
		{
			get 
			{
				return this.List[index];
			}
			set 
			{
				this.List[index] = value;
			}
		}
            
		#endregion

		#region Methods
		/// <summary>
		/// Adds and object to the collection
		/// </summary>
		/// <param name="o"></param>
		public virtual void Add(object o) 
		{
			this.List.Add(o);
		}
            
		
		/// <summary>
		/// Returns whether the given object is stored in the collection
		/// </summary>
		/// <param name="o">whatever object</param>
		/// <returns>true if contained otherwise false</returns>
		public virtual bool Contains(object o) 
		{
			return this.List.Contains(o);
		}
            
		
		/// <summary>
		/// Removes an element from the collection
		/// </summary>
		/// <param name="o"></param>
		public virtual void Remove(object o) 
		{
			this.List.Remove(o);
		}
		

		/// <summary>
		/// Overrides the default implementation to collect the data of the collection
		/// </summary>
		/// <returns></returns>
		public override string ToString() 
		{
			System.IO.StringWriter sw = new System.IO.StringWriter();
			// <foreach>
			// This loop mimics a foreach call. See C# programming language, pg 247
			// Here, the enumerator is seale and does not implement IDisposable
			System.Collections.IEnumerator enumerator = this.List.GetEnumerator();
			for (
				; enumerator.MoveNext(); 
				) 
			{
				string s = ((string)(enumerator.Current));
				// foreach body
				sw.Write(s);
			}
			// </foreach>
			return sw.ToString();
		}

		#endregion
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -