001package jmri.jmrit.operations.rollingstock.cars;
002
003import jmri.InstanceManager;
004
005/**
006 * Represents a car load, load's priority, and if
007 * the load is hazardous. Also includes pickup and drop comments.
008 *
009 * @author Daniel Boudreau (C) 2010
010 *
011 */
012public class CarLoad {
013
014    public static final String NONE = "";
015
016    public static final String PRIORITY_LOW = Bundle.getMessage("PriorityLow");
017    public static final String PRIORITY_MEDIUM = Bundle.getMessage("PriorityMedium");
018    public static final String PRIORITY_HIGH = Bundle.getMessage("PriorityHigh");
019
020    public static final String LOAD_TYPE_EMPTY = Bundle.getMessage("EmptyTypeName");
021    public static final String LOAD_TYPE_LOAD = Bundle.getMessage("LoadTypeName");
022
023    public static final String SPLIT_CHAR = " & "; // used to combine car type and load in tracks and trains
024
025    String _name;
026    String _priority = PRIORITY_LOW;
027    String _pickupComment = NONE;
028    String _dropComment = NONE;
029    String _loadType = LOAD_TYPE_LOAD;
030    boolean _hazardous = false;
031
032    public CarLoad(String name) {
033        setName(name);
034    }
035
036    public String getName() {
037        return _name;
038    }
039
040    public void setName(String name) {
041        _name = name;
042        if (name.equals(InstanceManager.getDefault(CarLoads.class).getDefaultEmptyName())) {
043            setLoadType(LOAD_TYPE_EMPTY);
044        }
045    }
046
047    public String getPriority() {
048        return _priority;
049    }
050
051    public void setPriority(String priority) {
052        _priority = priority;
053    }
054    
055    public boolean isHazardous() {
056        return _hazardous;
057    }
058    
059    public void setHazardous(boolean isHazardous) {
060        _hazardous = isHazardous;
061    }
062
063    public String getPickupComment() {
064        return _pickupComment;
065    }
066
067    public void setPickupComment(String comment) {
068        _pickupComment = comment;
069    }
070
071    public String getDropComment() {
072        return _dropComment;
073    }
074
075    public void setDropComment(String comment) {
076        _dropComment = comment;
077    }
078
079    public String getLoadType() {
080        return _loadType;
081    }
082
083    public void setLoadType(String type) {
084        _loadType = type;
085    }
086
087}