OLD | NEW |
1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 package fletch; | 5 package fletch; |
6 | 6 |
7 public class MessageBuilder { | 7 public class MessageBuilder { |
8 public MessageBuilder(int space) { | 8 public MessageBuilder(int space) { |
9 segments = 1; | 9 segments = 1; |
10 first = new BuilderSegment(this, 0, space); | 10 first = new BuilderSegment(this, 0, space); |
11 last = first; | 11 last = first; |
(...skipping 30 matching lines...) Expand all Loading... |
42 BuilderSegment segment = new BuilderSegment(this, segments++, capacity); | 42 BuilderSegment segment = new BuilderSegment(this, segments++, capacity); |
43 last.setNext(segment); | 43 last.setNext(segment); |
44 last = segment; | 44 last = segment; |
45 return segment; | 45 return segment; |
46 } | 46 } |
47 | 47 |
48 private BuilderSegment first; | 48 private BuilderSegment first; |
49 private BuilderSegment last; | 49 private BuilderSegment last; |
50 private int segments; | 50 private int segments; |
51 }; | 51 }; |
OLD | NEW |