com.sun.electric.technology
Class EdgeV

java.lang.Object
  extended by com.sun.electric.technology.EdgeV
All Implemented Interfaces:
java.io.Serializable

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

An EdgeV is a scalable Y coordinate that converts a NodeInst bounds to a location inside of that NodeInst. It consists of two numbers: a multiplier and an adder. The resulting location starts at the center of the NodeInst, adds the NodeInst height times the multiplier, adds the adder.

For example, the center of the NodeInst simply has multiplier = 0 and adder = 0. The bottom of the NodeInst has multiplier = -0.5 and adder = 0. The point that is 2 below the top has multiplier = 0.5 and adder = -2. The point that is 3 above the center has multiplier = 0 and adder = 3.

See Also:
Serialized Form

Constructor Summary
EdgeV(double multiplier, double adder)
          Constructs an EdgeV with the specified values.
 
Method Summary
 EdgeV duplicate()
          Returns a clone of this Object
 boolean equals(java.lang.Object other)
          Compare to another EdgeV
static EdgeV fromBottom(double amt)
          Describes a position that is in from the bottom by a specified amount.
static EdgeV fromCenter(double amt)
          Describes a position that is away from the center by a specified amount.
static EdgeV fromTop(double amt)
          Describes a position that is in from the top by a specified amount.
 double getAdder()
          Returns the adder.
 long getGridAdder()
          Returns the adder in grid units.
 double getMultiplier()
          Returns the multiplier.
static EdgeV makeBottomEdge()
          Creates a position that describes the bottom edge of the NodeInst.
static EdgeV makeCenter()
          Creates a position that describes the center of the NodeInst.
static EdgeV makeTopEdge()
          Creates a position that describes the top edge of the NodeInst.
 boolean setAdder(double adder)
          Sets the adder.
 void setMultiplier(double multiplier)
          Sets the multiplier.
 java.lang.String toString()
          Returns a printable version of this EdgeV.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EdgeV

public EdgeV(double multiplier,
             double adder)
Constructs an EdgeV with the specified values.

Parameters:
multiplier - is the multiplier to store in the EdgeV.
adder - is the adder to store in the EdgeV.
Method Detail

duplicate

public EdgeV duplicate()
Returns a clone of this Object

Returns:
a new pointer with the same value of this Object

equals

public boolean equals(java.lang.Object other)
Compare to another EdgeV

Overrides:
equals in class java.lang.Object
Parameters:
other - the other EdgeV to compare.
Returns:
true if the two have the same values.

getMultiplier

public double getMultiplier()
Returns the multiplier. This is the amount to scale a NodeInst height.

Returns:
the multiplier.

setMultiplier

public void setMultiplier(double multiplier)
Sets the multiplier. This is the amount to scale a NodeInst height.

Parameters:
multiplier - the new multiplier.

getAdder

public double getAdder()
Returns the adder. This is the amount to add to a NodeInst height.

Returns:
the adder.

getGridAdder

public long getGridAdder()
Returns the adder in grid units. This is the amount to add to a NodeInst height.

Returns:
the adder.

setAdder

public boolean setAdder(double adder)
Sets the adder. This is the amount to add to a NodeInst height.

Parameters:
adder - the new adder.
Returns:
true if original value was modified

fromTop

public static EdgeV fromTop(double amt)
Describes a position that is in from the top by a specified amount.

Parameters:
amt - the amount to inset from the top of a NodeInst.

fromBottom

public static EdgeV fromBottom(double amt)
Describes a position that is in from the bottom by a specified amount.

Parameters:
amt - the amount to inset from the bottom of a NodeInst.

fromCenter

public static EdgeV fromCenter(double amt)
Describes a position that is away from the center by a specified amount.

Parameters:
amt - the amount to move away from the center of the NodeInst.

makeBottomEdge

public static EdgeV makeBottomEdge()
Creates a position that describes the bottom edge of the NodeInst.

Returns:
a position that describes the bottom edge of the NodeInst.

makeTopEdge

public static EdgeV makeTopEdge()
Creates a position that describes the top edge of the NodeInst.

Returns:
a position that describes the top edge of the NodeInst.

makeCenter

public static EdgeV makeCenter()
Creates a position that describes the center of the NodeInst.

Returns:
a position that describes the center of the NodeInst.

toString

public java.lang.String toString()
Returns a printable version of this EdgeV.

Overrides:
toString in class java.lang.Object
Returns:
a printable version of this EdgeV.