com.path.android.jobqueue.nonPersistentQueue
Class NonPersistentJobSet

java.lang.Object
  extended by com.path.android.jobqueue.nonPersistentQueue.NonPersistentJobSet
All Implemented Interfaces:
JobSet

public class NonPersistentJobSet
extends java.lang.Object
implements JobSet

This is the default implementation of JobSet. It uses TreeSet as the underlying data structure. Is currently inefficient, should be replaced w/ a more efficient version


Constructor Summary
NonPersistentJobSet(java.util.Comparator<JobHolder> comparator)
           
 
Method Summary
 void clear()
           
 CountWithGroupIdsResult countReadyJobs(java.util.Collection<java.lang.String> excludeGroups)
           
 CountWithGroupIdsResult countReadyJobs(long now, java.util.Collection<java.lang.String> excludeGroups)
           
 JobHolder findById(long id)
           
 boolean offer(JobHolder holder)
           
 JobHolder peek(java.util.Collection<java.lang.String> excludeGroupIds)
           
 JobHolder poll(java.util.Collection<java.lang.String> excludeGroupIds)
           
 boolean remove(JobHolder holder)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NonPersistentJobSet

public NonPersistentJobSet(java.util.Comparator<JobHolder> comparator)
Method Detail

peek

public JobHolder peek(java.util.Collection<java.lang.String> excludeGroupIds)
Specified by:
peek in interface JobSet

poll

public JobHolder poll(java.util.Collection<java.lang.String> excludeGroupIds)
Specified by:
poll in interface JobSet

findById

public JobHolder findById(long id)
Specified by:
findById in interface JobSet

offer

public boolean offer(JobHolder holder)
Specified by:
offer in interface JobSet

remove

public boolean remove(JobHolder holder)
Specified by:
remove in interface JobSet

clear

public void clear()
Specified by:
clear in interface JobSet

size

public int size()
Specified by:
size in interface JobSet

countReadyJobs

public CountWithGroupIdsResult countReadyJobs(long now,
                                              java.util.Collection<java.lang.String> excludeGroups)
Specified by:
countReadyJobs in interface JobSet

countReadyJobs

public CountWithGroupIdsResult countReadyJobs(java.util.Collection<java.lang.String> excludeGroups)
Specified by:
countReadyJobs in interface JobSet