com.partnersoft.v3x.apps.Staker.domain
Class Span

java.lang.Object
  extended by com.partnersoft.v3x.apps.Staker.domain.Span
All Implemented Interfaces:
java.io.Serializable

public class Span
extends java.lang.Object
implements java.io.Serializable

A Span is the distance connecting a Location to its parent (or first ancestor that isn't an intermediate point). SpanUnits may be placed upon it; it also has some other properties of interest to stakers.

See Also:
Serialized Form

Constructor Summary
Span()
          Create a new, blank Span.
Span(Location location)
          Create a span for the given location.
 
Method Summary
 java.lang.Object clone()
           
 XyPolyline convertToPolyline()
          Returns the span's shape as an XyPolyline.
 java.lang.Object deepCopy()
           
 void forceAccountedToCalculated()
           
 void forceCalculatedToAccounted()
           
 int getAccountedSpan()
           
 double getCalculatedSpan()
           
 java.awt.Color getColor()
           
 java.util.List<StakedUnitCombo> getCombos()
           
 java.util.List<StakedUnitComboState> getComboStates()
          This accessor is used to store the combos in TOF format.
 XyDirection getDirection()
          Returns the direction of the backspan (from this location to the parent).
 LineDrawer getLineDrawer()
           
 Linetype getLinetype()
           
 java.lang.String getLinetypeName()
          Get name of linetype used to draw span.
 Location getLocation()
           
 OverUnder getOverUnder()
          Overhead or underground? One lump or two?
 Phase getPhase()
          Phase of the span.
 byte[] getSpanShape()
           
 SpanType getSpanType()
          This is the type of span for accounting purposes.
 StakeStatus getStatus()
          Existing, retired, or new.
 java.util.Set<UnitOnASpan> getUnits()
          Stuff on the span.
 boolean hasBackspan()
          Returns true if there is a backspan (parent != null) and it contains stations (intermediate points).
 boolean isConnected()
          Returns true if there is a backspan (parent != null).
 boolean isMatching()
           
 boolean isStraight()
          Returns true if there is a backspan (parent != null) and it contains no intermediate points.
 java.util.List<StakingNode> listNodes()
          Returns a list of nodes in this span.
 void paintOn(java.awt.Graphics g, RenderMold mold)
          Figures out where the centerpoint should be and calls paintOn(Graphics, Point);
 void setAccountedSpan(int newSpan)
           
 void setComboStates(java.util.List<StakedUnitComboState> newStates)
          This accessor is used to store the combos in TOF format.
 void setLinetypeName(java.lang.String newLinetypeName)
          Set name of linetype used to draw span.
 void setLocation(Location newLocation)
           
 void setMatching(boolean match)
           
 void setPhase(Phase newPhase)
           
 void setSpanType(SpanType newType)
           
 void setUnits(java.util.Set newUnits)
           
 UnitOnASpan stakedUnitWithGuid(java.lang.String guid)
           
 java.lang.String toString()
           
 void updateLineDrawer()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Span

public Span()
Create a new, blank Span.


Span

public Span(Location location)
Create a span for the given location.

Method Detail

forceAccountedToCalculated

public void forceAccountedToCalculated()

forceCalculatedToAccounted

public void forceCalculatedToAccounted()

paintOn

public void paintOn(java.awt.Graphics g,
                    RenderMold mold)
Figures out where the centerpoint should be and calls paintOn(Graphics, Point);


getColor

public java.awt.Color getColor()

getLineDrawer

public LineDrawer getLineDrawer()

getLinetype

public Linetype getLinetype()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

updateLineDrawer

public void updateLineDrawer()

isConnected

public boolean isConnected()
Returns true if there is a backspan (parent != null).


isStraight

public boolean isStraight()
Returns true if there is a backspan (parent != null) and it contains no intermediate points.

Returns:

hasBackspan

public boolean hasBackspan()
Returns true if there is a backspan (parent != null) and it contains stations (intermediate points).

Returns:

getDirection

public XyDirection getDirection()
Returns the direction of the backspan (from this location to the parent). If there are stations, this is the direction to the first parent station. Returns null if there is no parent.


convertToPolyline

public XyPolyline convertToPolyline()
Returns the span's shape as an XyPolyline. Returns null if there is no parent.

Returns:

getSpanShape

public byte[] getSpanShape()

getAccountedSpan

public int getAccountedSpan()

setAccountedSpan

public void setAccountedSpan(int newSpan)

getCalculatedSpan

public double getCalculatedSpan()

isMatching

public boolean isMatching()

setMatching

public void setMatching(boolean match)

getSpanType

public SpanType getSpanType()
This is the type of span for accounting purposes.


setSpanType

public void setSpanType(SpanType newType)

getUnits

public java.util.Set<UnitOnASpan> getUnits()
Stuff on the span.


setUnits

public void setUnits(java.util.Set newUnits)

getPhase

public Phase getPhase()
Phase of the span.


setPhase

public void setPhase(Phase newPhase)

getLocation

public Location getLocation()

setLocation

public void setLocation(Location newLocation)

getLinetypeName

public java.lang.String getLinetypeName()
Get name of linetype used to draw span.


setLinetypeName

public void setLinetypeName(java.lang.String newLinetypeName)
Set name of linetype used to draw span.


getStatus

public StakeStatus getStatus()
Existing, retired, or new.


getOverUnder

public OverUnder getOverUnder()
Overhead or underground? One lump or two?


listNodes

public java.util.List<StakingNode> listNodes()
Returns a list of nodes in this span. Includes both the location and parent location.


getCombos

public java.util.List<StakedUnitCombo> getCombos()

getComboStates

public java.util.List<StakedUnitComboState> getComboStates()
This accessor is used to store the combos in TOF format. It shouldn't be used for other purposes.

Returns:

setComboStates

public void setComboStates(java.util.List<StakedUnitComboState> newStates)
This accessor is used to store the combos in TOF format. It shouldn't be used for other purposes.


clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

deepCopy

public java.lang.Object deepCopy()

stakedUnitWithGuid

public UnitOnASpan stakedUnitWithGuid(java.lang.String guid)