org.android.activityminer.model.activitylabels
Class ActivityLabel

Package class diagram package ActivityLabel
java.lang.Object
  extended by org.android.activityminer.model.activitylabels.ActivityLabel
All Implemented Interfaces:
Parcelable, SerializableData

public class ActivityLabel
extends Object
implements SerializableData, Parcelable

The activity name representation


Nested Class Summary
 
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
 
Field Summary
static Parcelable.Creator<ActivityLabel> CREATOR
          The Parcelable creator.
 long id
          The unique activity identifier
 String name
          The activity name
private  ActivityLabel predecessor
          The predecessor
private  TreeSet<ActivityLabel> successors
          The successors
 
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
 
Constructor Summary
ActivityLabel(long id, String name)
          Constructor
ActivityLabel(Parcel source)
          Constructor
 
Method Summary
 void addSuccessor(ActivityLabel successor)
          Adds a successor activity
 ActivityLabel cloneWithName(String name)
          Method to clone an activity label with a new name
 int describeContents()
           
 List<ActivityLabel> getAllPredecessors()
          Getter for all predecessors
 List<ActivityLabel> getAllSuccessors()
          Getter for all successors
 long getId()
          Getter for the id
 String getName()
          Getter for the name
 ActivityLabel getPredecessor()
          Getter for the predecessor activity
 Collection<ActivityLabel> getSuccessorList()
          Getter for the successors
 Collection<ActivityLabel> getSuccessors()
          Getter for the successors
 boolean hasSuccessors()
          Test for successors
 void removeSuccessor(ActivityLabel successor)
          Adds a successor activity
 void setPredecessor(ActivityLabel predecessor)
          Setter for the predecessor activity
 String toString()
           
 String toXML()
           
 void writeToParcel(Parcel dest, int flags)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

public final long id
The unique activity identifier


name

public final String name
The activity name


predecessor

private ActivityLabel predecessor
The predecessor


successors

private final TreeSet<ActivityLabel> successors
The successors


CREATOR

public static final Parcelable.Creator<ActivityLabel> CREATOR
The Parcelable creator.

Constructor Detail

ActivityLabel

public ActivityLabel(long id,
                     String name)
Constructor

Parameters:
id - the unique identifier
name - the activity name

ActivityLabel

public ActivityLabel(Parcel source)
Constructor

Parameters:
source - the parcel to create from
Method Detail

writeToParcel

public final void writeToParcel(Parcel dest,
                                int flags)
Specified by:
writeToParcel in interface Parcelable

describeContents

public int describeContents()
Specified by:
describeContents in interface Parcelable

getId

public final long getId()
Getter for the id

Returns:
the id

getName

public final String getName()
Getter for the name

Returns:
the name

getPredecessor

public final ActivityLabel getPredecessor()
Getter for the predecessor activity

Returns:
the predecessor activity

setPredecessor

public final void setPredecessor(ActivityLabel predecessor)
Setter for the predecessor activity

Parameters:
predecessor - the predecessor activity to set

hasSuccessors

public boolean hasSuccessors()
Test for successors

Returns:
true if this activity label has successors, false otherwise

getAllPredecessors

public List<ActivityLabel> getAllPredecessors()
Getter for all predecessors

Returns:
a list with all predecessors

getSuccessors

public Collection<ActivityLabel> getSuccessors()
Getter for the successors

Returns:
the successors

getSuccessorList

public Collection<ActivityLabel> getSuccessorList()
Getter for the successors

Returns:
the successors

getAllSuccessors

public List<ActivityLabel> getAllSuccessors()
Getter for all successors

Returns:
a list with all successors

addSuccessor

public final void addSuccessor(ActivityLabel successor)
Adds a successor activity

Parameters:
successor - the successor activity to add

removeSuccessor

public final void removeSuccessor(ActivityLabel successor)
Adds a successor activity

Parameters:
successor - the successor activity to add

toString

public String toString()
Overrides:
toString in class Object

toXML

public String toXML()
             throws Exception
Specified by:
toXML in interface SerializableData
Throws:
Exception

cloneWithName

public final ActivityLabel cloneWithName(String name)
Method to clone an activity label with a new name

Parameters:
name - the new name
Returns:
the instance