From 254ee6f47eebfc00462c10756a92066e82cc1a96 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Tue, 21 Jun 2011 15:46:02 +0200 Subject: Initial commit --- .../c2kernel/gui/tabs/execution/ActivityItem.java | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 source/com/c2kernel/gui/tabs/execution/ActivityItem.java (limited to 'source/com/c2kernel/gui/tabs/execution/ActivityItem.java') diff --git a/source/com/c2kernel/gui/tabs/execution/ActivityItem.java b/source/com/c2kernel/gui/tabs/execution/ActivityItem.java new file mode 100755 index 0000000..1a73dc2 --- /dev/null +++ b/source/com/c2kernel/gui/tabs/execution/ActivityItem.java @@ -0,0 +1,46 @@ +package com.c2kernel.gui.tabs.execution; +import java.util.ArrayList; + +import com.c2kernel.entity.agent.Job; +import com.c2kernel.lifecycle.instance.stateMachine.States; + +public class ActivityItem { + public String stepPath; + public int state; + public String name; + ArrayList jobs = new ArrayList(); + + public ActivityItem(Job thisJob) { + stepPath = thisJob.getStepPath(); + state = thisJob.getCurrentState(); + name = thisJob.getStepName(); + jobs.add(thisJob); + } + + public void addJob(Job newJob) { + jobs.add(newJob); + } + + public ArrayList getJobs() { + return jobs; + } + + public String getStepPath() { + return stepPath; + } + + public String toString() { + return name+" ("+States.getStateName(state)+")"; + } + + public boolean equals(Object other) { + if (other instanceof ActivityItem) + return hashCode() == ((ActivityItem)other).hashCode(); + return false; + } + + public int hashCode() { + return stepPath.hashCode(); + } + +} -- cgit v1.2.3