public OclSequence reverse() { OclSequence newList = new OclSequence(elementType, list); newList.list.Reverse(); return(newList); }
public OclSequence prepend <T>(OclClassifier newElementType, T item) where T : OclAny { OclSequence newList = new OclSequence(newElementType, list); newList.list.Insert(0, item); return(newList); }
public OclSequence append <T>(OclClassifier newElementType, T item) where T : OclAny { OclSequence newList = new OclSequence(newElementType, list); newList.list.Add(item); return(newList); }
public OclSequence flattenToSequence() { OclSequence seq = new OclSequence(OclCollectionType.BasicElementType(elementType)); FlattenToList(seq.list, OclCollectionType.Depth(elementType)); return(seq); }
public OclSequence union(OclClassifier newElementType, OclSequence s) { OclSequence newList = new OclSequence(newElementType, list); newList.list.AddRange(s); return(newList); }
public OclSequence insertAt <T>(OclClassifier newElementType, OclInteger index, T item) where T : OclAny { OclSequence newList = new OclSequence(newElementType, list); int intIndex = (int)index; newList.list.Insert(intIndex - 1, item); return(newList); }
public OclSequence excluding <T>(T item) where T : OclAny { OclSequence newList = new OclSequence(elementType); foreach (OclAny i in list) { if (!i.Equals(item)) { newList.list.Add(i); } } return(newList); }
public OclSequence subSequence(OclInteger start, OclInteger end) { int intStart = (int)start, intEnd = (int)end; if (intEnd < intStart || intStart < 1 || intEnd > list.Count) { throw new IndexOutOfRangeException(); } OclSequence newList = new OclSequence(elementType); for (int i = intStart - 1; i < intEnd; ++i) { newList.list.Add(list[i]); } return(newList); }
public OclSequence characters() { OclSequence seq = new OclSequence(OclString.Type); for (int ptr = 0; ptr < value.Length; ++ptr) { if (CheckSurrogatePair(value, value.Length, ptr)) { seq.list.Add(new OclString(value.Substring(ptr, 2))); ++ptr; } else { seq.list.Add(new OclString(value[ptr])); } } return(seq); }