Ejemplo n.º 1
0
        public Sentinel(StrI1 <T> str, T sentinel)
        {
            _str      = str;
            _sentinel = sentinel;

            _enumerator = _str.ToEnumerable().GetEnumerator();
        }
Ejemplo n.º 2
0
        static public bool Contain <T, TEq>(this StrI1 <T> str, T x, TEq eq)
            where TEq : IEqualityComparer <T>
        {
            if (str is SansI)
            {
                return(false);
            }
            var seeded = str as str.SeededI_forGeneric <T>;

            return(eq.Equals(seeded.seed, x) || seeded.tail.Contain(x, eq));
        }
Ejemplo n.º 3
0
        static public bool IsDistinct <T, TEq>(this StrI1 <T> str, TEq eq)
            where TEq : IEqualityComparer <T>

        {
            if (str is str.SansI)
            {
                return(true);
            }
            var seeded = (str as str.SeededI_forGeneric <T>);

            return(seeded.tail.IsDistinct(eq) && seeded.tail.Contain(seeded.seed, eq));
        }
Ejemplo n.º 4
0
        static public bool IsDistinct_eqDefault <T, TEq>(this StrI1 <T> str)
            where TEq : IEqualityComparer <T>, new()

        {
            return(IsDistinct(str, SingletonByDefault <TEq> .Instance));
        }
Ejemplo n.º 5
0
 static public Enumerable1 <T> ToEnumerable <T>(this StrI1 <T> str)
 {
     return(new Enumerable1 <T>(str));
 }
Ejemplo n.º 6
0
 public Enumerable1(StrI1 <T> str)
 {
     _str = str;
 }
Ejemplo n.º 7
0
 public Started_tailStr(T seed, StrI1 <T> tail) : base(seed, tail)
 {
 }
Ejemplo n.º 8
0
 static public bool NotContain_eqDefault <T, TEq>(this StrI1 <T> str, T x)
     where TEq : IEqualityComparer <T>, new()
 {
     return(!str.Contain_eqDefault <T, TEq>(x));
 }
Ejemplo n.º 9
0
 static public bool NotContain <T, TEq>(this StrI1 <T> str, T x, TEq eq)
     where TEq : IEqualityComparer <T>
 {
     return(!str.Contain(x, eq));
 }
Ejemplo n.º 10
0
 static public bool Contain_eqDefault <T, TEq>(this StrI1 <T> str, T x)
     where TEq : IEqualityComparer <T>, new()
 {
     return(str.Contain(x, SingletonByDefault <TEq> .Instance));
 }