class CategorizedLegend implements AbstractAttributeLegend, ParameterLegend {

    @Override
    public ValueReference getValueReference() {
        SeParameter c = getParameter();
        if(c instanceof Categorize){
            RealParameter ret = ((Categorize) c).getLookupValue();
            if(ret instanceof ValueReference){
                return (ValueReference) ret;
            } else {
                throw new ClassCastException("We're not working with an authorized Categorize instance");
            }
        }
        return null;
    }

}