⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showburrow.java

📁 本书透彻讲解了经典的《设计模式:可复用面向对象软件的基础》一书涵盖的23种基本设计模式。本书将这些设计模式分成五类:接口型模式、责任型模式、构造型模式、操作型模式
💻 JAVA
字号:
package com.oozinoz.outside;

import com.oozinoz.units.Acceleration;
import com.oozinoz.units.Area;
import com.oozinoz.units.Density;
import com.oozinoz.units.Speed;
import com.oozinoz.units.Time;
import com.oozinoz.units.UnitConstants;

/*
 * Copyright (c) 2001 Steven J. Metsker.
 * 
 * Steve Metsker makes no representations or warranties about
 * the fitness of this software for any particular purpose, 
 * including the implied warranty of merchantability.
 *
 * Please use this software as you wish with the sole
 * restriction that you may not claim that you wrote it.
 */
/**
 * This class uses the devious Burrow class to alter a
 * SolidRocket simulation's protected attributes.
 * 
 * @author Steven J. Metsker
 */
public class ShowBurrow implements UnitConstants 
{
/**
 * This just demonstrates the creation of a SolidRocket
 * simulation using the subclass Burrow. The subclass lets
 * us alter the burn rate directly, although this winds up
 * creating a problem that the superclass avoids.
 */
public static void main(String[] args)
{
	// Establish a rocket's attibrutes. As it happens these
	// are pretty realistic values.
	Speed burnRate =
		(Speed) MILLIMETER.times(40).divide(SECOND);
	Area burnArea = (Area) CM.times(CM).times(100);
	Time burnTime = SECOND;
	Acceleration specificImpulse =
		(Acceleration) NEWTON.times(1200).divide(KILOGRAM);
	Density density =
		(Density) KILOGRAM.times(2400).divide(M).divide(
			M).divide(
			M);
	// Create a simulation of rocket
	Burrow b =
		new Burrow(
			"JSquirrel",
			burnRate,
			burnArea,
			burnTime,
			specificImpulse,
			density);
	// Change the burn rate, which we can do only because
	// we're using Burrow, not SolidRocket
	b.setBurnRate(
		(Speed) MILLIMETER.times(38).divide(SECOND));
}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -