public CharArray(CharArray array) { this.ordered = array.ordered; length = array.length; items = new char[length]; JavaSystem.Arraycopy(array.items, 0, items, 0, length); }
public override bool Equals(object o) { if (o == this) { return(true); } if (!(o is CharArray)) { return(false); } CharArray array = (CharArray)o; int n = length; if (n != array.length) { return(false); } for (int i = 0; i < n; i++) { if (items[i] != array.items[i]) { return(false); } } return(true); }
public void AddAll(CharArray array, int offset, int length) { if (offset + length > array.length) { throw new LSysException( "offset + length must be <= length: " + offset + " + " + length + " <= " + array.length); } AddAll(array.items, offset, length); }
public static CharArray Range(int start, int end) { CharArray array = new CharArray(end - start); for (int i = start; i < end; i++) { array.Add((char)i); } return(array); }
public CharArray Where(QueryEvent <Character> test) { CharArray list = new CharArray(); for (int i = 0; i < length; i++) { Character t = Character.ValueOf(Get(i)); if (test.Hit(t)) { list.Add(t.CharValue()); } } return(list); }
public CharArray Splice(int begin, int end) { CharArray longs = new CharArray(Slice(begin, end)); if (end - begin >= length) { items = new char[0]; length = 0; return(longs); } else { RemoveRange(begin, end - 1); } return(longs); }
public bool RemoveAll(CharArray array) { int length = this.length; int startlength = length; char[] items = this.items; for (int i = 0, n = array.length; i < n; i++) { int item = array.Get(i); for (int ii = 0; ii < length; ii++) { if (item == items[ii]) { RemoveIndex(ii); length--; break; } } } return(length != startlength); }
public CharArray Concat(CharArray o) { return(new CharArray(Concat(this.items, this.length, o.items, o.length))); }
public void AddAll(CharArray array) { AddAll(array, 0, array.length); }