using System;
using System.Collections.Generic;
using System.Linq;
namespace Implab.Automaton {
///
/// Dummy alphabet consists of integer numbers which are identical to their classes.
///
public class DummyAlphabet : IAlphabet {
readonly int m_size;
///
/// Creates a new dummy alphabet with given size.
///
/// The size of the alphabet, must be greater then zero.
public DummyAlphabet(int size) {
Safe.ArgumentAssert(size > 0);
m_size = 0;
}
#region IAlphabet implementation
public List[] CreateReverseMap() {
Enumerable.Range(0, m_size).ToArray();
}
public int Translate(int symbol) {
Safe.ArgumentInRange(symbol, 0, m_size, "symbol");
return symbol;
}
public bool Contains(int symbol) {
Safe.ArgumentInRange(symbol, 0, m_size, "symbol");
return true;
}
public int Count {
get {
return m_size;
}
}
#endregion
}
}