public ListStack(NonListStackData data, ListStack formerStack) : base(formerStack.OutStream) { _data = new NonListStackData[formerStack._data.Length + 1]; _data[0] = data; formerStack._data.CopyTo(_data, 1); }
ListStack(NonListStackData[] data, NonListStackData formerStackData) : base(formerStackData.OutStream) { _data = new NonListStackData[data.Length + 1]; data.CopyTo(_data, 0); _data[data.Length] = formerStackData; }
ListStack(NonListStackData[] data, ListStack formerStack) : base(formerStack.OutStream) { _data = new NonListStackData[data.Length + formerStack._data.Length]; data.CopyTo(_data, 0); formerStack._data.CopyTo(_data, data.Length); }
internal override StackData PushOnto(NonListStackData formerStack) => new ListStack(this, formerStack);
ListStack(NonListStackData[] data, IOutStream outStream) : base(outStream) { _data = data; }
DataStack.DataMemento GetItemMemento(NonListStackData item, int index) { return new DataStack.DataMemento(item.Dump()) { Size = item.Size.ToInt(), Offset = _data.Skip(index).Sum(item1 => item1.Size.ToInt()) }; }
string DumpItem(NonListStackData item, int index) { var offset = _data.Skip(index).Sum(item1 => item1.Size.ToInt()); return "[" + index + "]-" + offset + ": " + item.Dump(); }
public ListStack(NonListStackData top, NonListStackData formerStackData) : base(top.OutStream) { _data = new[] {top, formerStackData}; }
static BitsConst Paste(BitsConst bitsConst, NonListStackData data) => bitsConst.Concat(data.GetBitsConst());
StackData SubString(int start, int length) { switch(length) { case 0: return new EmptyStackData(OutStream); case 1: return _data[start]; default: { var newData = new NonListStackData[length]; for(var i = 0; i < length; i++) newData[i] = _data[start + i]; return new ListStack(newData, OutStream); } } }
internal override StackData PushOnto(NonListStackData formerStack) => formerStack;
internal virtual StackData PushOnto(NonListStackData formerStack) { NotImplementedMethod(formerStack); return null; }