@Test public void testIdShouldBePositive() throws Exception { assertEquals(0, intToPositiveLong(0)); assertEquals(1, intToPositiveLong(1)); assertEquals(10000, intToPositiveLong(10000)); assertEquals(Integer.MAX_VALUE, intToPositiveLong(Integer.MAX_VALUE)); assertEquals((long) Integer.MAX_VALUE + 1, intToPositiveLong(-1)); assertEquals((long) Integer.MAX_VALUE + 100, intToPositiveLong(-100)); assertEquals((long) Integer.MAX_VALUE - Integer.MIN_VALUE - 1, intToPositiveLong(Integer.MIN_VALUE + 1)); assertEquals((long) Integer.MAX_VALUE - Integer.MIN_VALUE, intToPositiveLong(Integer.MIN_VALUE)); }
static long intToPositiveLong(int value) { if (value >= 0) { return value; } else { return (long) Integer.MAX_VALUE - value; } }
BaseListItemAdapter extends ListItemAdapter<LI> implements SectionIndexer { static long intToPositiveLong(int value) { if (value >= 0) { return value; } else { return (long) Integer.MAX_VALUE - value; } } }
BaseListItemAdapter extends ListItemAdapter<LI> implements SectionIndexer { static long intToPositiveLong(int value) { if (value >= 0) { return value; } else { return (long) Integer.MAX_VALUE - value; } } BaseListItemAdapter(@Nonnull Context context, @Nonnull List<? extends LI> listItems);  BaseListItemAdapter(@Nonnull Context context, @Nonnull List<? extends LI> listItems, boolean fastScrollEnabled, boolean saveSelection); }
BaseListItemAdapter extends ListItemAdapter<LI> implements SectionIndexer { static long intToPositiveLong(int value) { if (value >= 0) { return value; } else { return (long) Integer.MAX_VALUE - value; } } BaseListItemAdapter(@Nonnull Context context, @Nonnull List<? extends LI> listItems);  BaseListItemAdapter(@Nonnull Context context, @Nonnull List<? extends LI> listItems, boolean fastScrollEnabled, boolean saveSelection); void onEvent(@Nonnull UserEvent event); void onEvent(@Nonnull AccountEvent event); void saveState(@Nonnull Bundle outState); boolean isSaveSelection(); @Override Object[] getSections(); @Override int getPositionForSection(int section); @Override int getSectionForPosition(int position); void unselect(); int getPositionById(@Nonnull String id); boolean isForceUnselected(); @Nullable LI getSelectedItem(); @Override long getItemId(int position); @Nonnull ListItemAdapterSelectionHelper<LI> getSelectionHelper(); }
BaseListItemAdapter extends ListItemAdapter<LI> implements SectionIndexer { static long intToPositiveLong(int value) { if (value >= 0) { return value; } else { return (long) Integer.MAX_VALUE - value; } } BaseListItemAdapter(@Nonnull Context context, @Nonnull List<? extends LI> listItems);  BaseListItemAdapter(@Nonnull Context context, @Nonnull List<? extends LI> listItems, boolean fastScrollEnabled, boolean saveSelection); void onEvent(@Nonnull UserEvent event); void onEvent(@Nonnull AccountEvent event); void saveState(@Nonnull Bundle outState); boolean isSaveSelection(); @Override Object[] getSections(); @Override int getPositionForSection(int section); @Override int getSectionForPosition(int position); void unselect(); int getPositionById(@Nonnull String id); boolean isForceUnselected(); @Nullable LI getSelectedItem(); @Override long getItemId(int position); @Nonnull ListItemAdapterSelectionHelper<LI> getSelectionHelper();  }