public class Convert extends ParserFunctionBase
https://en.wikipedia.org/wiki/Template:Convert/doc,
https://en.wikipedia.org/wiki/Help:Convert,
Serialized FormParserFunctionBase.ParserFunctionAdapter, ParserFunctionBase.ParserFunctionRef| Constructor and Description |
|---|
Convert() |
Convert(WikiConfig wikiConfig) |
| Modifier and Type | Method and Description |
|---|---|
protected static String |
convertBaseTo(double siBaseValue,
Units destUnit,
org.sweble.wikitext.engine.ext.convert.Convert.AbbreviationMode abbreviationMode,
int sigFig,
boolean isUsNameUsed)
Converts a SI base value to the given destination unit and returns the
default formated Number with unit descriptor.
|
protected static String |
convertToDefaultUnit(double value,
Units srcUnit,
org.sweble.wikitext.engine.ext.convert.Convert.AbbreviationMode abbreviationMode,
int sigFig,
boolean isUsNameUsed)
Converts the given source unit value to its default destination unit.
|
WtNode |
invoke(WtNode pnf,
ExpansionFrame frame,
List<? extends WtNode> args)
WtNode can either be a WtTemplate or a WtPageSwitch
|
compareTo, equals, getArgMode, getId, getWikiConfig, hashCode, isPageSwitch, nf, setWikiConfig, toString, tupublic Convert()
public Convert(WikiConfig wikiConfig)
public WtNode invoke(WtNode pnf, ExpansionFrame frame, List<? extends WtNode> args)
ParserFunctionBaseinvoke in class ParserFunctionBaseprotected static String convertToDefaultUnit(double value, Units srcUnit, org.sweble.wikitext.engine.ext.convert.Convert.AbbreviationMode abbreviationMode, int sigFig, boolean isUsNameUsed)
value - The value to convert.srcUnit - The unit type of the given value.abbreviationMode - Determines the way to describe the unit (symbol
or name).sigFig - The count of significant figures to round.isUsNameUsed - convertBaseTo()protected static String convertBaseTo(double siBaseValue, Units destUnit, org.sweble.wikitext.engine.ext.convert.Convert.AbbreviationMode abbreviationMode, int sigFig, boolean isUsNameUsed)
siBaseValue - The value given in a SI base unit.destUnit - The unit the value gets converted to.abbreviationMode - Determines whether the unit symbol or the entire
name is used as descriptor.sigFig - The count of significant figures to round.isUsNameUsed - Determines whether the US name is used or not (e.g.
"meter" instead of "metre").Copyright © 2010–2018 University of Erlangen-Nürnberg - Open Source Research Group. All rights reserved.