Exemplo n.º 1
0
            private void NeIntSeqObj(NeIntSeqObj obj)
            {
                int len  = obj.GetSize();
                int size = 2 * len;

                for (int i = 0; i < len; i++)
                {
                    size += LongPrintSize(obj.GetLongAt(i));
                }
                ConsumeSize(obj, size);
            }
Exemplo n.º 2
0
        private void NeIntSeqObj(NeIntSeqObj obj)
        {
            int len = obj.GetSize();

            writer.Write('(');

            if (IsMultiline(obj))
            {
                writer.Indent();

                // If we are on a fresh line, we start writing the first element
                // after the opening bracket, with just a space in between
                // Otherwise we start on the next line
                if (writer.IsNewLine())
                {
                    writer.Write(' ');
                }
                else
                {
                    writer.NewLine();
                }

                for (int i = 0; i < len; i++)
                {
                    if (i > 0)
                    {
                        writer.Write(',');
                        writer.NewLine();
                    }
                    writer.Write(obj.GetLongAt(i));
                }

                writer.UnindentedNewLine();
            }
            else
            {
                for (int i = 0; i < len; i++)
                {
                    if (i > 0)
                    {
                        writer.Write(", ");
                    }
                    writer.Write(obj.GetLongAt(i));
                }
            }

            writer.Write(')');
        }