<commit_before>package dimesweeper.positions;

import java.util.Objects;

/**
 * Created by EDave on 25.05.2015.
 */
public abstract class Position {
	public static Position create (int i) {
		return new PositionImpl (i, Position.NIL);
	}

	public abstract int getHead ();

	public abstract Position getTail ();

	public abstract boolean isEmpty ();

	public abstract boolean equals (Position pos);

	public abstract int hashCode ();

	public Position prepend (int newHead) {
		return new PositionImpl (newHead, this);
	}

	public abstract int getLength ();

	@Override
	public boolean equals (Object o) {
		return o instanceof Position && equals ((Position) o);
	}

	public static final Position NIL = new Position () {
		@Override
		public int getHead () {
			throw new IndexOutOfBoundsException ("cannot get head of NIL");
		}

		@Override
		public Position getTail () {
			throw new IndexOutOfBoundsException ("cannot get tail of NIL");
		}

		@Override
		public boolean isEmpty () {
			return true;
		}

		@Override
		public int getLength () {
			return 0;
		}

		@Override
		public boolean equals (Position pos) {
			return this == pos;
		}

		@Override
		public int hashCode () {
			return 0;
		}
	};

	private static class PositionImpl extends Position {
		private final int head;
		private final Position tail;
		private final int lenght;

		public PositionImpl (int head, Position tail) {
			this.head = head;
			this.tail = tail;
			this.lenght = tail.getLength () + 1;
		}

		@Override
		public int getHead () {
			return head;
		}

		@Override
		public Position getTail () {
			return tail;
		}

		@Override
		public boolean isEmpty () {
			return false;
		}

		@Override
		public int getLength () {
			return lenght;
		}

		@Override
		public boolean equals (Position pos) {
			return pos instanceof PositionImpl && equals ((PositionImpl) pos);
		}

		public boolean equals (PositionImpl pos) {
			return head == pos.head && tail.equals (pos.tail);
		}

		@Override
		public int hashCode () {
			return Objects.hash (head, tail);
		}
	}
}<commit_msg>Fixed typo<commit_after>package dimesweeper.positions;

import java.util.Objects;

/**
 * Created by EDave on 25.05.2015.
 */
public abstract class Position {
	public static Position create (int i) {
		return new PositionImpl (i, Position.NIL);
	}

	public abstract int getHead ();

	public abstract Position getTail ();

	public abstract boolean isEmpty ();

	public abstract boolean equals (Position pos);

	public abstract int hashCode ();

	public Position prepend (int newHead) {
		return new PositionImpl (newHead, this);
	}

	public abstract int getLength ();

	@Override
	public boolean equals (Object o) {
		return o instanceof Position && equals ((Position) o);
	}

	public static final Position NIL = new Position () {
		@Override
		public int getHead () {
			throw new IndexOutOfBoundsException ("cannot get head of NIL");
		}

		@Override
		public Position getTail () {
			throw new IndexOutOfBoundsException ("cannot get tail of NIL");
		}

		@Override
		public boolean isEmpty () {
			return true;
		}

		@Override
		public int getLength () {
			return 0;
		}

		@Override
		public boolean equals (Position pos) {
			return this == pos;
		}

		@Override
		public int hashCode () {
			return 0;
		}
	};

	private static class PositionImpl extends Position {
		private final int head;
		private final Position tail;
		private final int length;

		public PositionImpl (int head, Position tail) {
			this.head = head;
			this.tail = tail;
			this.length = tail.getLength () + 1;
		}

		@Override
		public int getHead () {
			return head;
		}

		@Override
		public Position getTail () {
			return tail;
		}

		@Override
		public boolean isEmpty () {
			return false;
		}

		@Override
		public int getLength () {
			return length;
		}

		@Override
		public boolean equals (Position pos) {
			return pos instanceof PositionImpl && equals ((PositionImpl) pos);
		}

		public boolean equals (PositionImpl pos) {
			return head == pos.head && tail.equals (pos.tail);
		}

		@Override
		public int hashCode () {
			return Objects.hash (head, tail);
		}
	}
}
{'fraction_non_alphanumeric': 0.09745454545454546, 'fraction_numerical': 0.005333333333333333, 'mean_word_length': 3.2274590163934427, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7306674', 'n_tokens_mistral': 1441, 'n_tokens_neox': 1209, 'n_words': 439}