Eliminated unused classes
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / parser / NLSLine.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2001, 2002 International Business Machines Corp. and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v0.5 
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v05.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  ******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler.parser;
12
13 import java.util.ArrayList;
14 import java.util.Iterator;
15 import java.util.List;
16
17 import net.sourceforge.phpeclipse.internal.compiler.ast.StringLiteral;
18
19 public class NLSLine {
20
21         private List elements;
22
23
24         public NLSLine() {
25                 this.elements = new ArrayList();
26         }
27         
28         /**
29          * Adds a NLS element to this line.
30          */
31         public void add(StringLiteral element) {
32                 this.elements.add(element);
33         }
34         
35         /**
36          * returns an Iterator over NLSElements
37          */
38         public Iterator iterator() {
39                 return this.elements.iterator();
40         }
41         
42         public StringLiteral get(int index) {
43                 return (StringLiteral) this.elements.get(index);
44         }
45         
46         public void set(int index, StringLiteral literal) {
47                 this.elements.set(index, literal);
48         }
49         
50         public boolean exists(int index) {
51                 return index >= 0 && index < this.elements.size();
52         }
53         
54         public int size(){
55                 return this.elements.size();
56         }
57         
58         public String toString() {
59                 StringBuffer result= new StringBuffer();
60                 for (Iterator iter= iterator(); iter.hasNext(); ) {
61                         result.append("\t"); //$NON-NLS-1$
62                         result.append(iter.next().toString());
63                         result.append("\n"); //$NON-NLS-1$
64                 }
65                 return result.toString();
66         }
67 }