- Timestamp:
- 10/18/13 21:33:56 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.GPDL/HeuristicLab.Grammars/3.3/Sequence.cs
r10063 r10067 21 21 22 22 using System.Collections.Generic; 23 using System.Collections.ObjectModel; 23 24 using System.Linq; 24 25 using System.Text; 25 26 26 27 namespace HeuristicLab.Grammars { 27 public class Sequence : List<ISymbol> { 28 public Sequence() 29 : base() { 30 } 31 32 public Sequence(IEnumerable<ISymbol> seq) 33 : base() { 34 this.AddRange(seq); 35 } 36 public IEnumerator<ISymbol> GetEnumerator() { 37 return (IEnumerator<ISymbol>)base.GetEnumerator(); 28 public class Sequence : ReadOnlyCollection<ISymbol> { 29 public Sequence(IList<ISymbol> seq) 30 : base(seq) { 38 31 } 39 32 … … 50 43 51 44 public override string ToString() { 52 var b = new StringBuilder(); 53 ForEach(s => b.AppendFormat("{0} ", s)); 54 return b.ToString(); 45 return this.Aggregate("", (str, symb) => str + symb); 55 46 } 56 47 }
Note: See TracChangeset
for help on using the changeset viewer.