live.dto
Class Thread

java.lang.Object
  extended bylive.dto.Thread

public class Thread
extends Object

This DTO is NOT runnable, it just holds information about a thread. And actually, it holds information that is specific to a ThreadedUserAction, so it's not generically useful for any thread.

Author:
Evan Driscoll

Nested Class Summary
static class Thread.ComparatorByDescription
          This comparator orders threads by their descriptions
static class Thread.ComparatorByResult
          This comparator orders threads by their descriptions
static class Thread.ComparatorByTimeEnded
          This comparator orders threads by the ending value.
static class Thread.ComparatorByTimeStarted
          This comparator orders threads by the starting value
static class Thread.ThreadComparator
          This is a base class for the different comparator styles.
 
Field Summary
private  String description
           
private  boolean finished
           
 int ID
           
private  boolean isContainer
           
private  String result
           
private  int status
           
private  Date timeEnded
           
private  Date timeStarted
           
 
Constructor Summary
Thread(int ID, String description, Date timeStarted, Date timeEnded, String result, int status)
          Makes a thread DTO with the specified attributes
Thread(ThreadedUserAction action)
          Same as Thread(int, String, Date, Date, String, int), but it pulls its parameters from a ThreadedUserAction
 
Method Summary
 Integer getBoxedID()
          Returns the ID as an Integer instead of an int.
 String getDescription()
          Returns the description
 int getID()
          Returns the thread ID
 String getResult()
          Returns the result string
 int getStatus()
          Returns the thread's status
 Date getTimeEnded()
          Returns the time the task ended
 Date getTimeStarted()
          Returns the time the task started
 boolean isContainer()
          Returns the whether it is a container
 boolean isFinished()
          Returns whether the task is finished
 void setDescription(String description)
          Sets the description
 void setResult(String result)
          Sets the result string to a value
 void setStatus(int status)
          Sets the thread's status
 void setTimeEnded(Date timeEnded)
          Sets the time the task ended
 void setTimeStarted(Date timeStarted)
          Sets the time the task started
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public int ID

description

private String description

timeEnded

private Date timeEnded

timeStarted

private Date timeStarted

finished

private boolean finished

result

private String result

status

private int status

isContainer

private boolean isContainer
Constructor Detail

Thread

public Thread(int ID,
              String description,
              Date timeStarted,
              Date timeEnded,
              String result,
              int status)
Makes a thread DTO with the specified attributes

Parameters:
ID - The ID of the thread
description - User-friendly description of what the thread is doing
timeStarted -
timeEnded -
result - User-friendly description of the thread's progress

Thread

public Thread(ThreadedUserAction action)
Same as Thread(int, String, Date, Date, String, int), but it pulls its parameters from a ThreadedUserAction

Parameters:
action - The action to get the thread's parameters from
Method Detail

isContainer

public boolean isContainer()
Returns the whether it is a container

Returns:
Whether it is a container or not

setDescription

public void setDescription(String description)
Sets the description

Parameters:
description - The description to set.

getDescription

public String getDescription()
Returns the description

Returns:
Returns the description.

setTimeStarted

public void setTimeStarted(Date timeStarted)
Sets the time the task started

Parameters:
timeStarted - The timeStarted to set.

getTimeStarted

public Date getTimeStarted()
Returns the time the task started

Returns:
Returns the timeStarted.

setTimeEnded

public void setTimeEnded(Date timeEnded)
Sets the time the task ended

Parameters:
timeEnded - The timeEnded to set.

getTimeEnded

public Date getTimeEnded()
Returns the time the task ended

Returns:
Returns the timeEnded.

isFinished

public boolean isFinished()
Returns whether the task is finished

Returns:
Returns whether the task is finished.

setResult

public void setResult(String result)
Sets the result string to a value

Parameters:
result - The result to set.

getResult

public String getResult()
Returns the result string

Returns:
the result.

getID

public int getID()
Returns the thread ID

Returns:
Returns the ID

getBoxedID

public Integer getBoxedID()
Returns the ID as an Integer instead of an int. Used for the struts tags that need objects upon which to do reflection.

Returns:
The ID as an Integer

setStatus

public void setStatus(int status)
Sets the thread's status

Parameters:
status - The status to set.

getStatus

public int getStatus()
Returns the thread's status

Returns:
Returns the status.


Copyright © 2005