to top
Android APIs
public class

WorkSource

extends Object
implements Parcelable
java.lang.Object
   ↳ android.os.WorkSource

Class Overview

Describes the source of some work that may be done by someone else. Currently the public representation of what a work source is is not defined; this is an opaque container.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<WorkSource> CREATOR
Public Constructors
WorkSource()
Create an empty work source.
WorkSource(WorkSource orig)
Create a new WorkSource that is a copy of an existing one.
Public Methods
boolean add(WorkSource other)
Merge the contents of other WorkSource in to this one.
void clear()
Clear this WorkSource to be empty.
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
boolean diff(WorkSource other)
Compare this WorkSource with another.
boolean remove(WorkSource other)
void set(WorkSource other)
Replace the current contents of this work source with the given work source.
void writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<WorkSource> CREATOR

Since: API Level 9

Public Constructors

public WorkSource ()

Since: API Level 9

Create an empty work source.

public WorkSource (WorkSource orig)

Since: API Level 9

Create a new WorkSource that is a copy of an existing one. If orig is null, an empty WorkSource is created.

Public Methods

public boolean add (WorkSource other)

Since: API Level 9

Merge the contents of other WorkSource in to this one.

Parameters
other The other WorkSource whose contents are to be merged.
Returns
  • Returns true if any new sources were added.

public void clear ()

Since: API Level 9

Clear this WorkSource to be empty.

public int describeContents ()

Since: API Level 9

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public boolean diff (WorkSource other)

Since: API Level 9

Compare this WorkSource with another.

Parameters
other The WorkSource to compare against.
Returns
  • If there is a difference, true is returned.

public boolean remove (WorkSource other)

Since: API Level 9

public void set (WorkSource other)

Since: API Level 9

Replace the current contents of this work source with the given work source. If other is null, the current work source will be made empty.

public void writeToParcel (Parcel dest, int flags)

Since: API Level 9

Flatten this object in to a Parcel.

Parameters
dest The Parcel in which the object should be written.
flags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.