Exemple #1
0
	void printMap(){
		for(int i = 0; i<keys->getLength();i++){
			cout<< "Key: "<<keys->get(i)<<endl;	
			valarray->get(i)->display();
			cout<<endl;
		}
	}
Exemple #2
0
	int count(const char* key){
		DynArray<int> * a = valarray->get(keys->indexofVal(key));
		int count = 0;
		for(int i = 0; i<a->getLength();i++){
			if(a->get(i) >= 0){
				count++;
			}	
		}
		return count;
	}
Exemple #3
0
	void set(const char * key, int val){
		if(keys->isIn(key)){
			valarray->get(keys->indexofVal(key))->add(val);
		}
		else{
			keys->add(key);
			DynArray<int> *vala = new DynArray<int>();
			vala->add(val);
			valarray->add(vala);
		}
			
	}
Exemple #4
0
	DynArray<int>* getAll(const char* key){
		return valarray->get(keys->indexofVal(key));
	}
Exemple #5
0
	void removeAll(const char* key){
		valarray->get(keys->indexofVal(key))->clear();	
		
	}