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

📄 attribute.java

📁 一个用java编写的从底层开始设计的小型数据库管理系统
💻 JAVA
字号:

package compiler;
import recordmanagement.*;
public class Attribute {
	public Table table;
	public byte attIndex;
	public Attribute(Table t, byte b){
		table = t;
		attIndex = b;
	}
	private static Attribute All = new Attribute(null, (byte)-1);
	//返回Singleton对象, *
	public static Attribute GetInstanceAll(){
		return Attribute.All;
	}
	//返回对象Table.*
	public static Attribute GetInstanceAllinTable(Table table){
		return new Attribute(table, (byte)-1);
	}
	public String toString(){
		if(table == null && attIndex == (byte)-1){
			return "*";
		}else if (table != null && attIndex == (byte)-1){
			return (table.getTableName() + ".*" );
		}else{
			return (table.getTableName() + "." + table.getSchema().getAttributeName(attIndex));
		}
		
	}
	public boolean equals(Object att){
		if (att instanceof Attribute){
			if ( ((Attribute)att).table == this.table  && ((Attribute)att).attIndex == this.attIndex){
				return true;
			}
		}
		return false;
	}
}

⌨️ 快捷键说明

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