Processing, 類XML
中的getFloatContent()
用法介紹。
用法
.getFloatContent()
.getFloatContent(defaultValue)
參數
defaultValue
(float)
屬性的默認值
返回
float
說明
以 float
形式返回元素的內容。如果沒有此類內容,則返回null
或提供的默認值。
例子
// The following short XML file called "positions.xml" is parsed
// in the code below. It must be in the project's "data" folder.
//
// <?xml version="1.0"?>
// <positions>
// <position id="0">128.111</position>
// <position id="1">256.222</position>
// <position id="2">512.333</position>
// </positions>
XML xml;
void setup() {
xml = loadXML("positions.xml");
XML firstChild = xml.getChild("position");
println(firstChild.getFloatContent());
}
// Sketch prints:
// 128.111
相關用法
- Processing XML.getFloat()用法及代碼示例
- Processing XML.getString()用法及代碼示例
- Processing XML.getInt()用法及代碼示例
- Processing XML.getName()用法及代碼示例
- Processing XML.getChild()用法及代碼示例
- Processing XML.getParent()用法及代碼示例
- Processing XML.getChildren()用法及代碼示例
- Processing XML.getAttributeCount()用法及代碼示例
- Processing XML.getContent()用法及代碼示例
- Processing XML.addChild()用法及代碼示例
- Processing XML.setString()用法及代碼示例
- Processing XML.listChildren()用法及代碼示例
- Processing XML.toString()用法及代碼示例
- Processing XML.setFloat()用法及代碼示例
- Processing XML.removeChild()用法及代碼示例
- Processing XML.setContent()用法及代碼示例
- Processing XML.setInt()用法及代碼示例
- Processing XML.format()用法及代碼示例
- Processing XML.listAttributes()用法及代碼示例
- Processing XML.hasChildren()用法及代碼示例
- Processing XML.hasAttribute()用法及代碼示例
- Processing XML.setName()用法及代碼示例
- Processing XML用法及代碼示例
- Processing FFT用法及代碼示例
- Processing SawOsc.pan()用法及代碼示例
注:本文由純淨天空篩選整理自processing.org大神的英文原創作品 XML.getFloatContent()。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。