package common.tags;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

abstract class Tag {
	abstract void write(DataOutput output) throws IOException;
	abstract void read(DataInput input, int depth, SizeTracker tracker) throws IOException;
	public abstract String toString();
	abstract TagType getType();
	public abstract Tag copy();
	
	String toString(int indent, int depth) {
		return this.toString();
	}

	public boolean equals(Object other) {
		return other instanceof Tag && this.getType() == ((Tag)other).getType();
	}

	public int hashCode() {
		return this.getType().getId();
	}
}
