summaryrefslogtreecommitdiff
path: root/src/minijava/symboltable/MMethodList.java
blob: 12d97cfa3683b420490e8d9fe31176cbf8021ebb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package minijava.symboltable;

import java.util.Vector;

public class MMethodList extends MType {
	Vector<MMethod> methods;
	
	MMethodList() {
		methods = new Vector<MMethod>();
	}
	
	public void addMethod(MMethod method) {
		methods.addElement(method);
	}
	
	public int findMethod(String m_name) {
		for (int i=0; i<methods.size(); i++) {
			if (methods.elementAt(i).name.equals(m_name)) {
				return i;
			}
		}
		return -1;
	}
	
	public int size() {
		return methods.size();
	}

	public MMethod At(int i) {
		return methods.elementAt(i);
	}
}