提交 87972ae3 编写于 作者: W wizardforcel

2019-12-01 00:12:17

上级 8546cd12
......@@ -86,4 +86,4 @@ sudo java -classpath .:classes:/opt/pi4j/lib/'*' MotorPWM
观看视频以查看最终结果
<iframe allowfullscreen="" frameborder="0" height="428" src="https://www.youtube.com/embed/OqBoNk0HCY8?feature=oembed" width="760"></iframe>
\ No newline at end of file
<https://www.youtube.com/embed/OqBoNk0HCY8?feature=oembed>
\ No newline at end of file
......@@ -144,7 +144,7 @@ sudo java -classpath .:classes:/opt/pi4j/lib/'*' ControlOneMotorDirection
以下视频演示了结果
&lt;iframe allowfullscreen="allowfullscreen" frameborder="0" height="315" src="https://www.youtube.com/embed/pim_hLJD5IE" width="560"&gt;&lt;/iframe&gt;
<https://www.youtube.com/embed/pim_hLJD5IE>
## 添加第二台电机(可选)
......@@ -233,7 +233,7 @@ sudo java -classpath .:classes:/opt/pi4j/lib/'*' ControlTwoMotorsDirection
以下视频演示了结果
&lt;iframe allowfullscreen="allowfullscreen" frameborder="0" height="315" src="https://www.youtube.com/embed/b7Fx7Q_qfUs" width="560"&gt;&lt;/iframe&gt;
<https://www.youtube.com/embed/b7Fx7Q_qfUs>
## Java 程序:控制两个直流电机的速度和方向
......@@ -353,7 +353,7 @@ sudo java -classpath .:classes:/opt/pi4j/lib/'*' ControlMotorsDirectionAndSpeed
以下视频演示了结果
&lt;iframe allowfullscreen="allowfullscreen" frameborder="0" height="315" src="https://www.youtube.com/embed/Jfuu-h_NYY0" width="560"&gt;&lt;/iframe&gt;
<https://www.youtube.com/embed/Jfuu-h_NYY0>
## 结论
......
......@@ -151,7 +151,7 @@ Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
</settings>
```
现在,转到包含`pom.xml`文件的文件夹并执行`mvn test``
现在,转到包含`pom.xml`文件的文件夹并执行`mvn test`
### 使用环境变量激活配置文件
......
......@@ -232,7 +232,7 @@ After adding elements to empty list:[Elephant, Tiger, Lion]
### 使用`contains()`检查`LinkedList`中是否存在元素
语法:boolean contains(Object o)`
语法:`boolean contains(Object o)`
```java
import java.io.*;
......
......@@ -26,7 +26,7 @@ Java 中的`HashSet`
## `HashSet`中的构造方法
1. HashSet hashSet = new HashSet();`
1. `HashSet hashSet = new HashSet();`
2. `HashSet hashSet = new HashSet(int initialCapacity);`
3. `HashSet hashSet = new HashSet(int initialCapacity, float loadFactor);`
4. `HashSet hashSet = new HashSet(Collection c);`
......
......@@ -88,7 +88,7 @@ public class SubscriptionGrabber implements Subject {
```
`.java`文件使用`Subject`接口。 请注意,在`setNewPrice(double newPrice)`方法中,我们在设置新价格后会通知用户。 重要的是,我们必须在价格变化后执行此操作,否则以后,如果其中有更多代码块,则可能会出现问题。 我们的`addSubscriber(Observer newSubscriber)和`removeSubscriber(Observer subscriber)`只是在观察者列表中添加人或从观察者列表中删除人。 我们需要在我们的模式中具有删除功能,因为我们的目的是仅通知订阅者,或者仅通知使用我们服务的人员。 我们无需通知不再使用我们服务的人员。 最后,此`.java`文件中的`final`方法仅对每个订户调用`update(double price)`方法(我们仍未创建)。
`.java`文件使用`Subject`接口。 请注意,在`setNewPrice(double newPrice)`方法中,我们在设置新价格后会通知用户。 重要的是,我们必须在价格变化后执行此操作,否则以后,如果其中有更多代码块,则可能会出现问题。 我们的`addSubscriber(Observer newSubscriber)``removeSubscriber(Observer subscriber)`只是在观察者列表中添加人或从观察者列表中删除人。 我们需要在我们的模式中具有删除功能,因为我们的目的是仅通知订阅者,或者仅通知使用我们服务的人员。 我们无需通知不再使用我们服务的人员。 最后,此`.java`文件中的`final`方法仅对每个订户调用`update(double price)`方法(我们仍未创建)。
`SubscriptionObserver.java`
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册