Ejemplo n.º 1
0
 public char Random()
 {
     if (length == 0)
     {
         return(CharUtils.ToChar(0));
     }
     return(items[MathUtils.Random(0, length - 1)]);
 }
Ejemplo n.º 2
0
 public char Get(int index)
 {
     if (index >= length)
     {
         return(CharUtils.ToChar(0));
     }
     return(items[index]);
 }
Ejemplo n.º 3
0
 public char NextChar()
 {
     if (Eof())
     {
         return(CharUtils.ToChar(-1));
     }
     return(context.CharAt(poistion));
 }
Ejemplo n.º 4
0
 public char ConsumeChar()
 {
     if (poistion < context.Length())
     {
         char consumedChar = context.CharAt(poistion);
         poistion++;
         return(consumedChar);
     }
     else
     {
         return(CharUtils.ToChar(-1));
     }
 }
Ejemplo n.º 5
0
        public char[] RandomArrays()
        {
            if (length == 0)
            {
                return(new char[0]);
            }
            char v = CharUtils.ToChar(-1);

            char[] newArrays = CollectionUtils.CopyOf(items, length);
            for (int i = 0; i < length; i++)
            {
                v = Random();
                for (int j = 0; j < i; j++)
                {
                    if (newArrays[j] == v)
                    {
                        v = Random();
                        j = -1;
                    }
                }
                newArrays[i] = v;
            }
            return(newArrays);
        }