class Box{

	private int height = 0;
	private int width = 0;
	private int length = 0;
	private double weight = 0.0;

	public Box(int h, int w, int l, double weight) {
		this.height = h;
		this.width = w;
		this.length = l;
		this.weight = weight;
	}

	public int getHeight() { return height; }
	public int getWidth() { return width; }
	public int getLength() { return length; }
	public double getWeight() { return weight; }

	public void setHeight(int h) {
		if (h > 0) {
			height = h;
		}
	}

	public void setWidth(int w) {
		if (w > 0) {
			width = w;
		}
	}

	public void setLength(int l) {
		if (l > 0) {
			length = l;
		}
	}

	public void setWeight(double w) {
		if (w >= 0) {
			weight = w;
		}
	}

	public int getVolume() {
		return height * width * length;
	}

	@Override
	public String toString() {
		return String.format("%d,%d,%d,%f", height, width, length, weight);
	}

	@Override
	public boolean equals(Object obj) {
		if(!(obj instanceof Box)) {
			return false;
		}

		Box that = (Box) obj;

		return (this.getVolume() == that.getVolume() &&
			this.weight == that.weight);
	}

} // end of class
