com.sun.electric.technology
Class EdgeH

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

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

An EdgeH is a scalable X 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 width times the multiplier, adds the adder.

For example, the center of the NodeInst simply has multiplier = 0 and adder = 0. The left edge of the NodeInst has multiplier = -0.5 and adder = 0. The point that is 2 left of the right edge has multiplier = 0.5 and adder = -2. The point that is 3 right of the center has multiplier = 0 and adder = 3.

See Also:
Serialized Form

Constructor Summary
EdgeH(double multiplier, double adder)
          Constructs an EdgeH with the specified values.
 
Method Summary
 boolean equals(java.lang.Object other)
          Compare to another EdgeH
static EdgeH fromCenter(double amt)
          Describes a position that is away from the center by a specified amount.
static EdgeH fromLeft(double amt)
          Describes a position that is in from the left by a specified amount.
static EdgeH fromRight(double amt)
          Describes a position that is in from the right by a specified amount.
 double getAdder()
          Returns the adder.
 long getGridAdder()
          Returns the adder in grid units.
 double getMultiplier()
          Returns the multiplier.
static EdgeH makeCenter()
          Creates a position that describes the center of the NodeInst.
static EdgeH makeLeftEdge()
          Creates a position that describes the left edge of the NodeInst.
static EdgeH makeRightEdge()
          Creates a position that describes the right edge of the NodeInst.
 java.lang.String toString()
          Returns a printable version of this EdgeH.
 EdgeH withAdder(double adder)
          Returns EdgeH with the new adder.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EdgeH

public EdgeH(double multiplier,
             double adder)
Constructs an EdgeH 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

equals

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

Overrides:
equals in class java.lang.Object
Parameters:
other - the other EdgeH 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 width.

Returns:
the multiplier.

getAdder

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

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.

withAdder

public EdgeH withAdder(double adder)
Returns EdgeH with the new adder.

Parameters:
adder - the new adder.
Returns:
EdgeH with the new adder

fromLeft

public static EdgeH fromLeft(double amt)
Describes a position that is in from the left by a specified amount.

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

fromRight

public static EdgeH fromRight(double amt)
Describes a position that is in from the right by a specified amount.

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

fromCenter

public static EdgeH 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.

makeLeftEdge

public static EdgeH makeLeftEdge()
Creates a position that describes the left edge of the NodeInst.

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

makeRightEdge

public static EdgeH makeRightEdge()
Creates a position that describes the right edge of the NodeInst.

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

makeCenter

public static EdgeH 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 EdgeH.

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