private int getDisabled() { int disabled = 0; for (final Link link : links) { if (!link.isEnabled()) { disabled++; } } return disabled; }
@Override public Object getItem(int i) { if (positionIsChannel(i)) { int j = 0; for (final Link link : links) { if (j == i && link.isEnabled()) { return link; } else if (link.isEnabled()) { j++; } } throw new IndexOutOfBoundsException(); } else if (positionIsSettings(i)) { return SettingsActivity.class; } else if (positionIsBookmarks(i)) { return BookmarksDisplay.class; } else if (positionIsAbout(i)) { return AboutDisplay.class; } return null; }