summaryrefslogtreecommitdiff
path: root/src/minijava/symboltable/MMethodList.java
blob: 34f79e6758bce2612054f63863a5dddab43694ad (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
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;
	}
}