package be.ac.ulb.code.wit.rangeparser;

import java.util.ArrayList;
import java.util.List;

public class MediaRange extends Range {
	private String type, subType;
	private List<String> substitutions = null;
	
	@Override
	public java.util.Collection<String> getSubstitutions() { 
		if (substitutions == null) {
			substitutions = new ArrayList<String>();
			substitutions.add(type + "/*");
			substitutions.add("*/*");
		}
		
		return substitutions;
	}
	
	public String getType() {
		return type;
	}

	public String getSubType() {
		return subType;
	}

	public MediaRange(String tag, List<Parameter> mediaParameters,
			List<Parameter> acceptParameters) throws NumberFormatException {
		super(tag, mediaParameters, acceptParameters);
		String[] typeSplit = tag.split("/");
		type = typeSplit[0];
		subType = typeSplit[1];
	}
	

}
