OBEROn SDK

com.oberon.ooql.sdk
Class ProgressCounter

java.lang.Object
  extended by com.oberon.ooql.sdk.ProgressCounter

public class ProgressCounter
extends java.lang.Object

The Progress Counter is used to retrieve the percentage of file upload / download

Since:
5.0.1
Version:
5.0

Constructor Summary
ProgressCounter(int countNum)
          Constructor
 
Method Summary
 void addCounterValue(float incr)
          Increment the selected counter value
 void addCounterValue(int counter, float incr)
          Change the counter selection and add an increment to the selected counter
 void forceCounter(int counter)
          Select one of the available counters with forced condition; after this selection the selectCounter(int) has no effect
 float getCounterNum()
          Return the number of counters
 float getCounterPerc()
          Get the current progress percentage for the selected counter
 float getCounterPerc(int counter)
          Get the current progress percentage for the specified counter
 float getCounterValue()
          Get the current value for the selected counter
 float getCounterValue(int counter)
          Get the current value for the specified counter
 float getMaximumValue()
          Get the maximum value for the currently selected counter
 int getSelected()
          Get the current selected counter
 boolean isCompleted()
          Check if the value of selected counter reached the maximum value
 boolean isFailed()
          Check if the current counter reports the failed condition [-1]
 void selectCounter(int counter)
          Select one of the available counters
 void setCompleted()
          Assign the maximum value to the selected counter
 void setCounterValue(float value)
          Assign a value to the selected counter
 void setCounterValue(int counter, float value)
          Change the counter selection and assign a value to the selected counter
 void setFailed()
          Assign the failed condition [-1] to the selected counter
 void setMaximumValue(float max)
          Set the maximum value for the currently selected counter
 void setUpdateListener(ProgressListener listener)
          Assign a listener for the update event It runs every time the counter value is changed
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProgressCounter

public ProgressCounter(int countNum)
Constructor

Parameters:
countNum - number of counters (generally equals to files transferred)
Method Detail

getCounterNum

public float getCounterNum()
Return the number of counters


selectCounter

public void selectCounter(int counter)
Select one of the available counters

Parameters:
counter - the counter number

forceCounter

public void forceCounter(int counter)
Select one of the available counters with forced condition; after this selection the selectCounter(int) has no effect

Parameters:
counter - the counter number

getSelected

public int getSelected()
Get the current selected counter

See Also:
selectCounter(int)

setMaximumValue

public void setMaximumValue(float max)
Set the maximum value for the currently selected counter

Parameters:
max - the max value

getMaximumValue

public float getMaximumValue()
Get the maximum value for the currently selected counter


setCounterValue

public void setCounterValue(int counter,
                            float value)
Change the counter selection and assign a value to the selected counter

Parameters:
counter - the counter number
value - the assigned value

setCounterValue

public void setCounterValue(float value)
Assign a value to the selected counter

Parameters:
value - the assigned value

addCounterValue

public void addCounterValue(int counter,
                            float incr)
Change the counter selection and add an increment to the selected counter

Parameters:
counter - the counter number
incr - the increment value

addCounterValue

public void addCounterValue(float incr)
Increment the selected counter value

Parameters:
incr - the increment value

getCounterValue

public float getCounterValue(int counter)
Get the current value for the specified counter

Parameters:
counter - the counter number

getCounterValue

public float getCounterValue()
Get the current value for the selected counter


getCounterPerc

public float getCounterPerc(int counter)
Get the current progress percentage for the specified counter

Parameters:
counter - the counter number

getCounterPerc

public float getCounterPerc()
Get the current progress percentage for the selected counter


setCompleted

public void setCompleted()
Assign the maximum value to the selected counter


setFailed

public void setFailed()
Assign the failed condition [-1] to the selected counter


isCompleted

public boolean isCompleted()
Check if the value of selected counter reached the maximum value


isFailed

public boolean isFailed()
Check if the current counter reports the failed condition [-1]


setUpdateListener

public void setUpdateListener(ProgressListener listener)
Assign a listener for the update event It runs every time the counter value is changed


OBEROn SDK

Copyright © 2008-2014 Mirko Solazzi. All Rights Reserved.