我为以下简单示例生成了javadoc:
c = a + (0.5f * (b - a))
我运行float moveTime = 10.0f; // In seconds
float moveTimer = 0.0f; // Used for keeping track of time
bool moving = false; // Flag letting us know if we're moving
float heightChange = 10.0f; // This is the delta
// These will be assigned when a collision occurs
Vector3 target; // our target position
Vector3 startPos; // our starting position
void OnTriggerEnter2D(Collider2D other)
{
if (!moving)
{
// We set the target to be ten units above our current position
target = transform.position + Vector3.up * heightChange;
// And save our start position (because our actual position will be changing)
startPos = transform.position;
// Set the flag so that the movement starts
moving = true;
}
}
void Update()
{
// If we're currently moving and the movement hasn't finished
if (moving && moveTimer < moveTime)
{
// Accumulate the frame time, making the timer tick up
moveTimer += Time.deltaTime;
// calculate our ratio ("t")
float t = moveTimer / moveTime;
transform.position = Vector3.Lerp(startPos, target, t);
}
else
{
// We either haven't started moving, or have finished moving
}
}
。
我希望public class test {
/**
* foo does something.
*
* @param x the parameter
*/
public void foo(int x) {}
}
以非比例字体显示名称,并且以比例字体显示说明,例如,对于官方JDK javadocs,就会发生这种情况。相反,我得到了此捕获中显示的内容:
这对于简短的描述是可以的,但对于较长的描述它是丑陋的。我做错了什么?
答案 0 :(得分:2)
当您比较Java 7和Java 8的Object.equals(obj)
的Java API文档时,您将看到
参数:
obj - 要与之比较的参考对象。
一部分。您将看到所有其他方法的参数,我只是选择了众所周知的方法作为示例。
换句话说,这是Java 7与Java 8当前版本之间JavaDoc行为的一般变化,并且您没有做错任何事。
如果您查看the stylesheet,您会发现负责描述部分的定义从第287行开始,包含属性font-family:'DejaVu Sans Mono',monospace;
。