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

📄 xmlstack.java

📁 短信网关发送接受平台。
💻 JAVA
字号:
package XML;
import java.util.*;

public class XMLStack{
	private Vector str=new Vector();
	protected int size=0;
        private boolean tag=false;

	public XMLStack(){
	}

	public boolean empty(){
		if (str.size()==0){
			return true;
		}else{
			return false;
		}
	}

	public String peek(){
                if (str.size()>0){
        		return (String)this.str.elementAt(str.size()-1);
	        }else{
                        return "";
                }
        }

	public String pop(){
                this.tag=true;
                if (this.size>0){
			String result=(String)this.str.elementAt(str.size()-1);
			this.size--;
			str.remove(this.size);
			return result;
		}else{
			return null;
		}
	}

	public boolean push(String s){
		this.tag=false;
                if (this.str.add(s)){
			this.size++;
			return true;
		}else{
			return false;
		}

	}

	public int search(String s){
		for (int i=0;i<this.str.size();i++){
			if (s.equals((String)this.str.elementAt(i))){
				return i;
			}
		}
		return -1;
	}

	public String createKey(){
		String result="";
		for (int i=0;i<this.str.size();i++){
			result+="/"+this.str.elementAt(i);
		}
		return result;
	}

	public void realease(){
		this.str.clear();
		this.size=0;
	}

        public boolean isTag(){
                return this.tag;
        }
}

⌨️ 快捷键说明

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