CompareTo(object obj) { if (obj is IPrimitiveToken) { IPrimitiveToken pToken = (IPrimitiveToken)obj; switch (pToken.Type) { case PrimitiveType.Boolean: case PrimitiveType.Null: return(_value.CompareTo(pToken.ToBoolean())); case PrimitiveType.Number: case PrimitiveType.String: return(1); } } throw new ArgumentException(); }