com.stanfy.enroscar.content.OffsetInfoArrayList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of enroscar-content Show documentation
Show all versions of enroscar-content Show documentation
Helper classes and extended abstractions for Android loaders, content resolvers, and DB access.
package com.stanfy.enroscar.content;
import java.util.Collection;
import android.util.Log;
/**
* List with offset information.
* @param element type
*/
public class OffsetInfoArrayList extends TaggedArrayList implements OffsetInfoProvider {
/** serialVersionUID. */
private static final long serialVersionUID = -8169767168744868104L;
public OffsetInfoArrayList() { super(); }
public OffsetInfoArrayList(final int capacity) { super(capacity); }
public OffsetInfoArrayList(final Collection extends E> collection) { super(collection); }
@Override
public boolean moreElementsAvailable(final String currentOffset) {
final OffsetInfoTag tag = (OffsetInfoTag)this.tag;
if (tag == null) { return false; }
try {
final long currentO = Long.parseLong(currentOffset);
return currentO < tag.getMaxOffsetCount();
} catch (final NumberFormatException e) {
Log.e("OffsetInfoProvider", "moreElementsAvailable: Cannot parse current offset value <" + currentOffset + ">, return false", e);
return false;
}
}
}