📄 facility.java
字号:
package com.power.pipeengine.Entity;
import java.util.*;
import com.power.pipeengine.*;
public class Facility extends com.power.pipeengine.Entity.Entity
{
private int _facilityID;
private String _description;
private String _facilityType;
private Vector _products;
private Hashtable _originatingFrom; //inventory points that ship to this facility
private Hashtable _destinations; //inventory points that receive from this facility
private Hashtable _workingCal = null;
private String _facilityIDStr = null;
public Integer IntegerID;
private int sequenceID;
public Facility( int i, String s, String type ){
_facilityID = i;
IntegerID = new Integer( i );
_description = s;
_facilityType = type;
_workingCal = new Hashtable();
_products = new Vector();
_originatingFrom = new Hashtable();
_destinations = new Hashtable();
_facilityIDStr = ( new Integer( i ) ).toString();
}
public void setSequenceID( int anInt ) {
sequenceID = anInt;
}
public int getSequenceID() {
return sequenceID;
}
public String getFacilityIDString(){
return _facilityIDStr;
}
public int getFacilityID() {
return _facilityID;
}
public Vector getProducts() {
return _products;
}
public String getDescription() {
return _description;
}
public String getFacilityType() {
return _facilityType;
}
public void addProduct( Product p ) {
_products.addElement( p );
}
public void addOriginatingFacility( Facility f, Shipment s ) {
String key = new Integer( f.getFacilityID() ).toString();
Vector shipments = (Vector) _originatingFrom.get( key );
if( shipments == null ) {
shipments = new Vector();
shipments.addElement( s );
_originatingFrom.put( key, shipments );
} else {
shipments.addElement( s );
}
}
public Hashtable getOrignatingFacilities() {
return _originatingFrom;
}
public void addDestinationFacility( Facility f, Shipment s ) {
String key = new Integer( f.getFacilityID() ).toString();
Vector shipments = (Vector) _destinations.get( key );
if( shipments == null ) {
shipments = new Vector();
shipments.addElement( s );
_destinations.put( key, shipments );
} else {
shipments.addElement( s );
}
}
public Hashtable getDestinationFacilities() {
return _destinations;
}
public void addWorkingCalendarEntry( int b, double wdays ) {
_workingCal.put( new Integer( b ).toString(), new Double( wdays ) );
}
public double getNumWorkingDaysForBucket( int b ) {
return ((Double)_workingCal.get( new Integer( b ).toString() ) ).doubleValue();
}
public void print() {
System.out.println( _facilityID + "," +
_description + "," +
_facilityType + "," +
_workingCal + "," +
getVariableCode() );
}
public int hashCode() {
return _facilityID;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -