All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.stanfy.enroscar.content.OffsetInfoArrayList Maven / Gradle / Ivy

Go to download

Helper classes and extended abstractions for Android loaders, content resolvers, and DB access.

There is a newer version: 2.1
Show newest version
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 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;

    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy