?? struct.cs
字號:
using System;
namespace DataTypeDemo
{
/// <summary>
/// stuct 的摘要說明。
/// </summary>
public class Struct : linkList
{
private node top;
//private int length;
private node botton;
//private linkList link;
/*public int Length
{
get{return this.length;}
set{this.length = value;}
}*/
public Struct()
{
//
// TODO: 在此處添加構(gòu)造函數(shù)邏輯
//
top = null;
botton = null;
//base.length = 0;
//link = null;
}
/**
*isEmpty
* checked The stuct was empty
* <PARAM>
* <RETURN> -
* <NOTES>
* <HISTORY> 2004/6/21 by LiJun
*/
public bool isEmpty()
{
bool isempty;
if(this.top == this.botton)
{
isempty = true;
}
else
{
isempty = false;
}
return isempty;
}
/**
*CreateStruct
* Create empty struct
* <PARAM>
* <RETURN> -
* <NOTES>
* <HISTORY> 2004/6/21 by LiJun
*/
public void CreateStruct()
{
//link = new linkList();
base.CreateLinkList();
this.botton = base.head;
//this.top = this.botton;
}
/**
*CreateStruct
* object[] data
* <PARAM>
* <RETURN> -
* <NOTES>
* <HISTORY> 2004/6/21 by LiJun
*/
public void CreateStruct(object[] data)
{
this.CreateStruct();
base.CreateLinkList(data);
this.botton = base.head;
this.top = base.treil.Up;
//System.Windows.Forms.MessageBox.Show(this.length.ToString());
//System.Windows.Forms.MessageBox.Show(link.Treil.Up.Up.Data.ToString());
}
/**
*Push
*
* <PARAM> object data
* <RETURN> -
* <NOTES>
* <HISTORY> 2004/6/21 by LiJun
*/
public void Push(object data)
{
if(this.isEmpty() != true)
{
base.AddNode(data);
this.top = base.treil.Up;
}
//System.Windows.Forms.MessageBox.Show(this.length.ToString());
}
/**
*Pop
*
* <PARAM>
* <RETURN> -
* <NOTES>
* <HISTORY> 2004/6/21 by LiJun
*/
public object Pop()
{
object d = null;
if(this.isEmpty() != true)
{
this.top = base.treil.Up;
d = this.top.Data;
base.DeleteNode();
//this.top = base.treil.Up;
}
//System.Windows.Forms.MessageBox.Show(this.top.Up.Data.ToString());
return d;
}
/**
*SetEmpty
*
* <PARAM>
* <RETURN> -
* <NOTES>
* <HISTORY> 2004/6/21 by LiJun
*/
public override void SetEmpty()
{
if(this.isEmpty() != true)
{
base.SetEmpty();
this.CreateStruct();
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -