org.autopipes
Class TakeoutMgrImp

java.lang.Object
  extended by org.autopipes.TakeoutMgrImp
All Implemented Interfaces:
TakeoutMgr

public class TakeoutMgrImp
extends java.lang.Object
implements TakeoutMgr

Primary implementation of TakeoutMgr.


Field Summary
 
Fields inherited from interface org.autopipes.TakeoutMgr
DATAFILE
 
Constructor Summary
TakeoutMgrImp()
          Hydrates the instance using takeout xml found on the path.
 
Method Summary
 double getCouplingTakeout(java.math.BigDecimal diam)
          Gets takeout for a branch pipe at a coupling.
 int getDiameterId(java.math.BigDecimal diam)
          Validates and retrieves diameter's surrogate key for all pipes.
 int getMainDiameterId(java.math.BigDecimal diam)
          Validates and retrieves diameter's surrogate key for main pipes.
 double getMainTakeout(java.math.BigDecimal diam, java.lang.String ven)
          Gets takeout for a branch pipe at a main ellbow.
 double getOrthoTakeout(java.math.BigDecimal brdiam, java.math.BigDecimal ordiam, boolean forMain)
          Gets takeout for a branch pipe at an orthogonal join.
 int getVendorId(java.lang.String ven)
          Validates and retrieves vendor's surrogate key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TakeoutMgrImp

public TakeoutMgrImp()
              throws javax.xml.bind.JAXBException
Hydrates the instance using takeout xml found on the path.

Throws:
javax.xml.bind.JAXBException
Method Detail

getCouplingTakeout

public double getCouplingTakeout(java.math.BigDecimal diam)
Gets takeout for a branch pipe at a coupling.

Specified by:
getCouplingTakeout in interface TakeoutMgr
Parameters:
diam - diameter of the branch.
Returns:
the takeout or -1 if no such coupling exists.

getMainTakeout

public double getMainTakeout(java.math.BigDecimal diam,
                             java.lang.String ven)
Gets takeout for a branch pipe at a main ellbow.

Specified by:
getMainTakeout in interface TakeoutMgr
Parameters:
diam - diameter of the main
ven - vendor who manufactured the ellbow.
Returns:
the takeout or -1 if no such ellbow exists.

getOrthoTakeout

public double getOrthoTakeout(java.math.BigDecimal brdiam,
                              java.math.BigDecimal ordiam,
                              boolean forMain)
Gets takeout for a branch pipe at an orthogonal join.

Specified by:
getOrthoTakeout in interface TakeoutMgr
Parameters:
brdiam - diameter of the pipe.
ordiam - maximum diameter of the orthogonal branch at the join.
forMain - true if the pipe orthogonal to the branch is main.
Returns:
the takeout or -1 if no such join exists.

getDiameterId

public int getDiameterId(java.math.BigDecimal diam)
Validates and retrieves diameter's surrogate key for all pipes.

Specified by:
getDiameterId in interface TakeoutMgr
Parameters:
diam - diameter's measure in inches.
Returns:
the key.

getMainDiameterId

public int getMainDiameterId(java.math.BigDecimal diam)
Validates and retrieves diameter's surrogate key for main pipes.

Specified by:
getMainDiameterId in interface TakeoutMgr
Parameters:
diam - diameter's measure in inches.
Returns:
the key.

getVendorId

public int getVendorId(java.lang.String ven)
Validates and retrieves vendor's surrogate key.

Specified by:
getVendorId in interface TakeoutMgr
Parameters:
ven - vendor's name
Returns:
the key.