com.partnersoft.job.model
Class Chain

java.lang.Object
  extended by com.partnersoft.job.model.JobDataComponent
      extended by com.partnersoft.job.model.Chain
All Implemented Interfaces:
Coggable

public class Chain
extends JobDataComponent

Author:
Paul Reavis Copyright 2004 Partner Software, Inc.

Constructor Summary
Chain()
           
 
Method Summary
 void addLocation(Location newLoc)
           
 void addSpan(Span newSpan)
           
 java.util.ArrayList allSpansFor(Location location)
           
 java.util.ArrayList allSpansFrom(Location location)
           
 java.util.ArrayList allSpansTo(Location location)
           
 Location firstChildOf(Location location)
           
 Location firstParentOf(Location location)
           
 void generateID()
          Subclass homework.
 Alternative getAlternative()
           
 Point getCentroid()
           
 Job getJob()
           
 java.util.ArrayList getLocations()
          Gets the value of locations
 java.util.ArrayList getSpans()
          Gets the value of spans
 Cog getState()
          Subclasses extend this by calling super.getState() and then adding their own state to the result.
 boolean isEmpty()
           
 void move(double offsetX, double offsetY)
          Moves the entire chain by the given offsets.
 void recenter(double newX, double newY)
           
 void remove()
          Removes this chain from its alternative.
 java.util.ArrayList[] remove(Location location)
          Removes the location from the chain.
 void remove(java.lang.Object whatsit)
           
 void remove(Span span)
           
 void setAlternative(Alternative newAlternative)
           
 void setLocations(java.util.ArrayList argLocations)
          Sets the value of locations
 void setSpans(java.util.ArrayList argSpans)
          Sets the value of spans
 void setState(Cog state)
          Subclasses should extend this by calling super.setState() and then setting their own state from the input.
 
Methods inherited from class com.partnersoft.job.model.JobDataComponent
copy, copyStateFrom, generateGuid, generateStandardIDs, getData, getGuid, getID, getName, getType, setData, setGuid, setID, setName, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Chain

public Chain()
Method Detail

addLocation

public void addLocation(Location newLoc)

addSpan

public void addSpan(Span newSpan)

allSpansFor

public java.util.ArrayList allSpansFor(Location location)

allSpansTo

public java.util.ArrayList allSpansTo(Location location)

allSpansFrom

public java.util.ArrayList allSpansFrom(Location location)

remove

public java.util.ArrayList[] remove(Location location)
Removes the location from the chain. Returns a list of any spans that are also deleted, a list of spans that used to go "to" the location, and a list of spans that used to go "from" the location, in that order.


remove

public void remove(Span span)

remove

public void remove(java.lang.Object whatsit)

firstParentOf

public Location firstParentOf(Location location)

firstChildOf

public Location firstChildOf(Location location)

move

public void move(double offsetX,
                 double offsetY)
Moves the entire chain by the given offsets.


recenter

public void recenter(double newX,
                     double newY)

getJob

public Job getJob()

getCentroid

public Point getCentroid()

isEmpty

public boolean isEmpty()

generateID

public void generateID()
Description copied from class: JobDataComponent
Subclass homework. Component should assign itself a unique integer ID (often more useful than a GUID for dealing with legacy systems or in reports and such). Generally this is by consulting an ID registry; the job actually serves this purpose for all its components.

Specified by:
generateID in class JobDataComponent

remove

public void remove()
Removes this chain from its alternative.

Specified by:
remove in class JobDataComponent

getState

public Cog getState()
Description copied from class: JobDataComponent
Subclasses extend this by calling super.getState() and then adding their own state to the result.

Specified by:
getState in interface Coggable
Overrides:
getState in class JobDataComponent

setState

public void setState(Cog state)
Description copied from class: JobDataComponent
Subclasses should extend this by calling super.setState() and then setting their own state from the input.

Specified by:
setState in interface Coggable
Overrides:
setState in class JobDataComponent

getAlternative

public Alternative getAlternative()

setAlternative

public void setAlternative(Alternative newAlternative)

getLocations

public java.util.ArrayList getLocations()
Gets the value of locations

Returns:
the value of locations

setLocations

public void setLocations(java.util.ArrayList argLocations)
Sets the value of locations

Parameters:
argLocations - Value to assign to this.locations

getSpans

public java.util.ArrayList getSpans()
Gets the value of spans

Returns:
the value of spans

setSpans

public void setSpans(java.util.ArrayList argSpans)
Sets the value of spans

Parameters:
argSpans - Value to assign to this.spans