FileDocCategorySizeDatePackage
ClassPresenterSelector.javaAPI DocAndroid 5.1 API1388Thu Mar 12 22:22:56 GMT 2015android.support.v17.leanback.widget

ClassPresenterSelector

public final class ClassPresenterSelector extends PresenterSelector
A ClassPresenterSelector selects a {@link Presenter} based on the item's Java class.

Fields Summary
private final HashMap
mClassMap
Constructors Summary
Methods Summary
public voidaddClassPresenter(java.lang.Class cls, Presenter presenter)


          
        mClassMap.put(cls, presenter);
    
public PresentergetPresenter(java.lang.Object item)

        Class<?> cls = item.getClass();
        Presenter presenter = null;

        do {
            presenter = mClassMap.get(cls);
            cls = cls.getSuperclass();
        } while (presenter == null && cls != null);

        return presenter;