Android Open Source - Save-the-Planet I Progress






From Project

Back to project page Save-the-Planet.

License

The source code is released under:

Copyright (c) 2002 JSON.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software ...

If you think the Android project Save-the-Planet listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.karolmajta.stp.models;
//ww  w .j  a  v  a  2 s.  c o m
import com.karolmajta.stp.exception.NoTasksInProgressQueueException;

/**
 * Model for various types of progress bars. Collects task, can process
 * them one-by-one and provide information on how many of theme were
 * processed.
 * 
 * @author Karol
 *
 */
public interface IProgress {
  /**
   * Adds task binding a weight to it.
   * 
   * @param task ITask to be processed
   * @param weight Weight associated with ITask. If two tasks are added with weights
   *     2 and 3, the first one is responsible for 40% of progress and second for 60%.
   * @return unique id of added task (unique in context of this IProgress Instance).
   */
  public int addTask(ITask task, int weight);
  
  /**
   * Returns the sum of weights of all tasks (processed and not) that were added
   * to this IProgress 
   * 
   * @return sum of all weights ever added to this IProgress.
   */
  public int getTotal();
  
  /**
   * Returns sum of events that were processed.
   * 
   * @return
   */
  public int getProcessed();
  
  /**
   * Mark ITask with given id as processed.
   * 
   * @param id uniqie (in this instance context) id of ITask
   */
  public void markAsProcessed(int id);
  
  /**
   * 
   * @return true if there are unprocessed tasks in the queue, false otheriws.e
   */
  public boolean hasNextTask();
  
  /**
   * Process current task in queue.
   * 
   * @return true if after processing current task there are others in queue.
   * @throws when called on IProgress that has no more tasks to process.
   */
  public boolean doNext() throws NoTasksInProgressQueueException;
}




Java Source Code List

com.karolmajta.procprox.DragDetector.java
com.karolmajta.procprox.Drag.java
com.karolmajta.procprox.FontManager.java
com.karolmajta.procprox.IEventFilter.java
com.karolmajta.procprox.TapDetector.java
com.karolmajta.procprox.Tap.java
com.karolmajta.procprox.excepiton.FontNotCreatedException.java
com.karolmajta.stp.LoadingScreenActivity.java
com.karolmajta.stp.MainMenuActivity.java
com.karolmajta.stp.exception.NoDeferredException.java
com.karolmajta.stp.exception.NoTasksInProgressQueueException.java
com.karolmajta.stp.exception.STPException.java
com.karolmajta.stp.exception.UnboundViewException.java
com.karolmajta.stp.models.ICanCollide.java
com.karolmajta.stp.models.IPConstants.java
com.karolmajta.stp.models.IProgress.java
com.karolmajta.stp.models.ITask.java
com.karolmajta.stp.models.ITickable.java
com.karolmajta.stp.models.MainMenuItemBall.java
com.karolmajta.stp.models.MainMenuObstacleBall.java
com.karolmajta.stp.models.ObstacleManager.java
com.karolmajta.stp.models.SyncProgress.java
com.karolmajta.stp.models.SyncTask.java
com.karolmajta.stp.models.Tickable.java
com.karolmajta.stp.models.Viewport.java
com.karolmajta.stp.views.FancyTextView.java
com.karolmajta.stp.views.IDrawable.java
com.karolmajta.stp.views.MainMenuItemBallDebugView.java
com.karolmajta.stp.views.MainMenuItemBallView.java
com.karolmajta.stp.views.MainMenuObstacleBallDebugView.java
com.karolmajta.stp.views.MainMenuObstacleBallView.java
com.karolmajta.stp.views.ObstacleManagerView.java
com.karolmajta.stp.views.ProgressDebugView.java
com.karolmajta.stp.views.ProgressView.java
com.karolmajta.stp.views.View.java