painless.asciidoc 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  1. [[modules-scripting-painless]]
  2. === Painless Scripting Language
  3. experimental[The Painless scripting language is new and is still marked as experimental. The syntax or API may be changed in the future in non-backwards compatible ways if required.]
  4. _Painless_ is a simple, secure scripting language available in Elasticsearch
  5. by default. It is designed specifically for use with Elasticsearch and can
  6. safely be used with `inline` and `stored` scripting, which is enabled by
  7. default.
  8. A Painless script is essentially a single function. Painless does not provide support
  9. for defining multiple functions within a script. The Painless syntax is similar to
  10. http://groovy-lang.org/index.html[Groovy].
  11. You can use Painless anywhere a script can be used in Elasticsearch--simply set the `lang` parameter
  12. to `painless`.
  13. [[painless-features]]
  14. [float]
  15. == Painless Features
  16. * Control flow: `for` loops, `while` loops, `do/while` loops, `if/else`
  17. * Fully Typed: all available types/methods described in <<painless-api, Painless API>>
  18. * Arithmetic operators: multiplication `*`, division `/`, addition `+`, subtraction `-`, precedence `( )`
  19. * Comparison operators: less than `<`, less than or equal to `<=`, greater than `>`, greater than or equal to `>=`, equal to `==`, and not equal to `!=`, reference equals `===`, reference not equals `!==`
  20. * Boolean operators: not `!`, and `&&`, or `||`
  21. * Bitwise operators: shift left `<<`, shift right `>>`, unsigned shift `>>>`, and `&`, or `|`, xor `^`, not `~`
  22. * Shortcuts for list, map access using the dot `.` operator
  23. * Native support for regular expressions with `/pattern/`, `=~`, and `==~`
  24. [[painless-examples]]
  25. [float]
  26. == Painless Examples
  27. To illustrate how Painless works, let's load some hockey stats into an Elasticsearch index:
  28. [source,js]
  29. ----------------------------------------------------------------
  30. PUT hockey/player/_bulk?refresh
  31. {"index":{"_id":1}}
  32. {"first":"johnny","last":"gaudreau","goals":[9,27,1],"assists":[17,46,0],"gp":[26,82,1]}
  33. {"index":{"_id":2}}
  34. {"first":"sean","last":"monohan","goals":[7,54,26],"assists":[11,26,13],"gp":[26,82,82]}
  35. {"index":{"_id":3}}
  36. {"first":"jiri","last":"hudler","goals":[5,34,36],"assists":[11,62,42],"gp":[24,80,79]}
  37. {"index":{"_id":4}}
  38. {"first":"micheal","last":"frolik","goals":[4,6,15],"assists":[8,23,15],"gp":[26,82,82]}
  39. {"index":{"_id":5}}
  40. {"first":"sam","last":"bennett","goals":[5,0,0],"assists":[8,1,0],"gp":[26,1,0]}
  41. {"index":{"_id":6}}
  42. {"first":"dennis","last":"wideman","goals":[0,26,15],"assists":[11,30,24],"gp":[26,81,82]}
  43. {"index":{"_id":7}}
  44. {"first":"david","last":"jones","goals":[7,19,5],"assists":[3,17,4],"gp":[26,45,34]}
  45. {"index":{"_id":8}}
  46. {"first":"tj","last":"brodie","goals":[2,14,7],"assists":[8,42,30],"gp":[26,82,82]}
  47. {"index":{"_id":39}}
  48. {"first":"mark","last":"giordano","goals":[6,30,15],"assists":[3,30,24],"gp":[26,60,63]}
  49. {"index":{"_id":10}}
  50. {"first":"mikael","last":"backlund","goals":[3,15,13],"assists":[6,24,18],"gp":[26,82,82]}
  51. {"index":{"_id":11}}
  52. {"first":"joe","last":"colborne","goals":[3,18,13],"assists":[6,20,24],"gp":[26,67,82]}
  53. ----------------------------------------------------------------
  54. // CONSOLE
  55. // TESTSETUP
  56. [float]
  57. === Accessing Doc Values from Painless
  58. Document values can be accessed from a `Map<String,def>` named `doc`.
  59. For example, the following script calculates a player's total goals. This example uses a strongly typed `int` and a `for` loop.
  60. [source,js]
  61. ----------------------------------------------------------------
  62. GET hockey/_search
  63. {
  64. "query": {
  65. "function_score": {
  66. "script_score": {
  67. "script": {
  68. "lang": "painless",
  69. "inline": "int total = 0; for (int i = 0; i < doc['goals'].length; ++i) { total += doc['goals'][i]; } return total;"
  70. }
  71. }
  72. }
  73. }
  74. }
  75. ----------------------------------------------------------------
  76. // CONSOLE
  77. Alternatively, you could do the same thing using a script field instead of a function score:
  78. [source,js]
  79. ----------------------------------------------------------------
  80. GET hockey/_search
  81. {
  82. "query": {
  83. "match_all": {}
  84. },
  85. "script_fields": {
  86. "total_goals": {
  87. "script": {
  88. "lang": "painless",
  89. "inline": "int total = 0; for (int i = 0; i < doc['goals'].length; ++i) { total += doc['goals'][i]; } return total;"
  90. }
  91. }
  92. }
  93. }
  94. ----------------------------------------------------------------
  95. // CONSOLE
  96. The following example uses a Painless script to sort the players by their combined first and last names. The names are accessed using
  97. `doc['first'].value` and `doc['last'].value`.
  98. [source,js]
  99. ----------------------------------------------------------------
  100. GET hockey/_search
  101. {
  102. "query": {
  103. "match_all": {}
  104. },
  105. "sort": {
  106. "_script": {
  107. "type": "string",
  108. "order": "asc",
  109. "script": {
  110. "lang": "painless",
  111. "inline": "doc['first.keyword'].value + ' ' + doc['last.keyword'].value"
  112. }
  113. }
  114. }
  115. }
  116. ----------------------------------------------------------------
  117. // CONSOLE
  118. [float]
  119. === Updating Fields with Painless
  120. You can also easily update fields. You access the original source for a field as `ctx._source.<field-name>`.
  121. First, let's look at the source data for a player by submitting the following request:
  122. [source,js]
  123. ----------------------------------------------------------------
  124. GET hockey/_search
  125. {
  126. "fields": [
  127. "_id",
  128. "_source"
  129. ],
  130. "query": {
  131. "term": {
  132. "_id": 1
  133. }
  134. }
  135. }
  136. ----------------------------------------------------------------
  137. // CONSOLE
  138. To change player 1's last name to `hockey`, simply set `ctx._source.last` to the new value:
  139. [source,js]
  140. ----------------------------------------------------------------
  141. POST hockey/player/1/_update
  142. {
  143. "script": {
  144. "lang": "painless",
  145. "inline": "ctx._source.last = params.last",
  146. "params": {
  147. "last": "hockey"
  148. }
  149. }
  150. }
  151. ----------------------------------------------------------------
  152. // CONSOLE
  153. You can also add fields to a document. For example, this script adds a new field that contains
  154. the player's nickname, _hockey_.
  155. [source,js]
  156. ----------------------------------------------------------------
  157. POST hockey/player/1/_update
  158. {
  159. "script": {
  160. "lang": "painless",
  161. "inline": "ctx._source.last = params.last; ctx._source.nick = params.nick",
  162. "params": {
  163. "last": "gaudreau",
  164. "nick": "hockey"
  165. }
  166. }
  167. }
  168. ----------------------------------------------------------------
  169. // CONSOLE
  170. [float]
  171. [[modules-scripting-painless-regex]]
  172. === Regular expressions
  173. Painless's native support for regular expressions has syntax constructs:
  174. * `/pattern/`: Pattern literals create patterns. This is the only way to create
  175. a pattern in painless. The pattern inside the `/`s are just
  176. http://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html[Java regular expressions].
  177. See <<modules-scripting-painless-regex-flags>> for more.
  178. * `=~`: The find operator return a `boolean`, `true` if a subsequence of the
  179. text matches, `false` otherwise.
  180. * `==~`: The match operator returns a `boolean`, `true` if the text matches,
  181. `false` if it doesn't.
  182. Using the find operator (`=~`) you can update all hockey players with "b" in
  183. their last name:
  184. [source,js]
  185. ----------------------------------------------------------------
  186. POST hockey/player/_update_by_query
  187. {
  188. "script": {
  189. "lang": "painless",
  190. "inline": "if (ctx._source.last =~ /b/) {ctx._source.last += \"matched\"} else {ctx.op = 'noop'}"
  191. }
  192. }
  193. ----------------------------------------------------------------
  194. // CONSOLE
  195. Using the match operator (`==~`) you can update all the hockey players who's
  196. names start with a consonant and end with a vowel:
  197. [source,js]
  198. ----------------------------------------------------------------
  199. POST hockey/player/_update_by_query
  200. {
  201. "script": {
  202. "lang": "painless",
  203. "inline": "if (ctx._source.last ==~ /[^aeiou].*[aeiou]/) {ctx._source.last += \"matched\"} else {ctx.op = 'noop'}"
  204. }
  205. }
  206. ----------------------------------------------------------------
  207. // CONSOLE
  208. Or you can use the `Pattern.matcher` directory to get a `Matcher` instance and
  209. remove all of the vowels in all of their names:
  210. [source,js]
  211. ----------------------------------------------------------------
  212. POST hockey/player/_update_by_query
  213. {
  214. "script": {
  215. "lang": "painless",
  216. "inline": "ctx._source.last = /[aeiou]/.matcher(ctx._source.last).replaceAll('')"
  217. }
  218. }
  219. ----------------------------------------------------------------
  220. // CONSOLE
  221. Note: all of the `_update_by_query` examples above could really do with a
  222. `query` to limit the data that they pull back. While you *could* use a
  223. <<query-dsl-script-query>> it wouldn't be as efficient as using any other query
  224. because script queries aren't able to use the inverted index to limit the
  225. documents that they have to check.
  226. We intentionally don't allow scripts to call `Pattern.compile` to get a new
  227. pattern on the fly because building a `Pattern` is (comparatively) slow.
  228. Pattern literals (`/apattern/`) have fancy constant extraction so no matter
  229. where they show up in the painless script they are built only when the script
  230. is first used. It is fairly similar to how `String` literals work in Java.
  231. [float]
  232. [[modules-scripting-painless-regex-flags]]
  233. ==== Regular expression flags
  234. You can define flags on patterns in Painless by adding characters after the
  235. trailing `/` like `/foo/i` or `/foo \w #comment/iUx`. Painless exposes all the
  236. flags from
  237. https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html[Java's Pattern class]
  238. using these characters:
  239. [cols="<,<,<",options="header",]
  240. |=======================================================================
  241. | Character | Java Constant | Example
  242. |`c` | CANON_EQ | `'å' ==~ /å/c` (open in hex editor to see)
  243. |`i` | CASE_INSENSITIVE | `'A' ==~ /a/i`
  244. |`l` | LITERAL | `'[a]' ==~ /[a]/l`
  245. |`m` | MULTILINE | `'a\nb\nc' =~ /^b$/m`
  246. |`s` | DOTALL (aka single line) | `'a\nb\nc' =~ /.b./s`
  247. |`U` | UNICODE_CHARACTER_CLASS | `'Ɛ' ==~ /\\w/U`
  248. |`u` | UNICODE_CASE | `'Ɛ' ==~ /ɛ/iu`
  249. |`x` | COMMENTS (aka extended) | `'a' ==~ /a #comment/x`
  250. |=======================================================================
  251. [[painless-api]]
  252. [float]
  253. == Painless API
  254. The following types are available for use in the Painless language. Most types and methods map directly to their Java equivalents--for more information, see the corresponding https://docs.oracle.com/javase/8/docs/api/java/lang/package-summary.html[Javadoc].
  255. [float]
  256. === Dynamic Types
  257. * `def` (This type can be used to represent any other type.)
  258. [float]
  259. === Basic Types
  260. * `void`
  261. * `boolean`
  262. * `short`
  263. * `char`
  264. * `int`
  265. * `long`
  266. * `float`
  267. * `double`
  268. [float]
  269. === Complex Types
  270. Non-static methods/members in superclasses are available to subclasses.
  271. Generic types with unspecified generic parameters are parameters of type `def`.
  272. -----
  273. ArithmeticException extends Exception
  274. <init>()
  275. -----
  276. -----
  277. ArrayList extends List
  278. <init>()
  279. -----
  280. -----
  281. ArrayList<Object> extends List<Object>
  282. <init>()
  283. -----
  284. -----
  285. ArrayList<String> extends List<String>
  286. <init>()
  287. -----
  288. -----
  289. Boolean extends Object
  290. <init>(boolean)
  291. static Boolean valueOf(boolean)
  292. boolean booleanValue()
  293. -----
  294. -----
  295. Character extends Object
  296. <init>(char)
  297. static Character valueOf(char)
  298. char charValue()
  299. static char MIN_VALUE
  300. static char MAX_VALUE
  301. -----
  302. -----
  303. CharSequence extends Object
  304. char charAt(int)
  305. int length()
  306. -----
  307. -----
  308. Collection extends Object
  309. boolean add(def)
  310. void clear()
  311. boolean contains(def)
  312. boolean isEmpty()
  313. Iterator iterator()
  314. boolean remove(def)
  315. int size()
  316. -----
  317. -----
  318. Collection<Object> extends Object
  319. boolean add(Object)
  320. void clear()
  321. boolean contains(Object)
  322. boolean isEmpty()
  323. Iterator iterator()
  324. boolean remove(Object)
  325. int size()
  326. -----
  327. -----
  328. Collection<String> extends Object
  329. boolean add(String)
  330. void clear()
  331. boolean contains(String)
  332. boolean isEmpty()
  333. Iterator iterator()
  334. boolean remove(String)
  335. int size()
  336. -----
  337. -----
  338. Double extends Number
  339. <init>(double)
  340. static Double valueOf(double)
  341. static double MIN_VALUE
  342. static double MAX_VALUE
  343. -----
  344. -----
  345. Exception extends Object
  346. String getMessage()
  347. -----
  348. -----
  349. Float extends Number
  350. <init>(float)
  351. static Float valueOf(float)
  352. static float MIN_VALUE
  353. static float MAX_VALUE
  354. -----
  355. -----
  356. HashMap extends Map
  357. <init>()
  358. -----
  359. -----
  360. HashMap<Object,Object> extends Map<Object,Object>
  361. <init>()
  362. -----
  363. -----
  364. HashMap<String,def> extends Map<String,def>
  365. <init>()
  366. -----
  367. -----
  368. HashMap<String,Object> extends Map<String,Object>
  369. <init>()
  370. -----
  371. -----
  372. IllegalArgument extends Exception
  373. <init>()
  374. -----
  375. -----
  376. IllegalState extends Exception
  377. <init>()
  378. -----
  379. -----
  380. Integer extends Number
  381. <init>(int)
  382. static Integer valueOf(int)
  383. static int MIN_VALUE
  384. static int MAX_VALUE
  385. -----
  386. -----
  387. Iterator extends Object
  388. boolean hasNext()
  389. def next()
  390. void remove()
  391. -----
  392. -----
  393. Iterator<String> extends Object
  394. boolean hasNext()
  395. String next()
  396. void remove()
  397. -----
  398. -----
  399. List extends Collection
  400. def set(int, def)
  401. def get(int)
  402. def remove(int)
  403. -----
  404. -----
  405. List<Object> extends Collection
  406. Object set(int, Object)
  407. Object get(int)
  408. Object remove(int)
  409. -----
  410. -----
  411. List<String> extends Collection
  412. String set(int, String)
  413. String get(int)
  414. String remove(int)
  415. -----
  416. -----
  417. Long extends Number
  418. <init>(long)
  419. static Long valueOf(long)
  420. static long MIN_VALUE
  421. static long MAX_VALUE
  422. -----
  423. -----
  424. Map extends Object
  425. def put (def, def)
  426. def get (def)
  427. def remove (def)
  428. boolean isEmpty()
  429. int size()
  430. boolean containsKey(def)
  431. boolean containsValue(def)
  432. Set keySet()
  433. Collection values()
  434. -----
  435. -----
  436. Map<Object,Object> extends Object
  437. Object put (Object, Object)
  438. Object get (Object)
  439. Object remove (Object)
  440. boolean isEmpty()
  441. int size()
  442. boolean containsKey(Object)
  443. boolean containsValue(Object)
  444. Set keySet()
  445. Collection values()
  446. -----
  447. -----
  448. Map<String,def> extends Object
  449. def put (String, def)
  450. def get (String)
  451. def remove (String)
  452. boolean isEmpty()
  453. int size()
  454. boolean containsKey(String)
  455. boolean containsValue(def)
  456. Set<String> keySet()
  457. Collection values()
  458. -----
  459. -----
  460. Map<String,Object> extends Object
  461. Object put (String, Object)
  462. Object get (String)
  463. Object remove (String)
  464. boolean isEmpty()
  465. int size()
  466. boolean containsKey(String)
  467. boolean containsValue(Object)
  468. Set<String> keySet()
  469. Collection values()
  470. -----
  471. -----
  472. Number extends Object
  473. short shortValue()
  474. short shortValue()
  475. int intValue()
  476. long longValue()
  477. float floatValue()
  478. double doubleValue()
  479. -----
  480. -----
  481. Object
  482. String toString()
  483. boolean equals(Object)
  484. int hashCode()
  485. -----
  486. -----
  487. Set extends Collection
  488. -----
  489. -----
  490. Set<Object> extends Collection<Object>
  491. -----
  492. -----
  493. Set<String> extends Collection<String>
  494. -----
  495. -----
  496. Short extends Number
  497. <init>(short)
  498. static Short valueOf(short)
  499. static short MIN_VALUE
  500. static short MAX_VALUE
  501. -----
  502. -----
  503. String extends CharSequence
  504. <init>(String)
  505. int codePointAt(int)
  506. int compareTo(String)
  507. String concat(String)
  508. boolean endsWith(String)
  509. int indexOf(String, int)
  510. boolean isEmpty()
  511. String replace(CharSequence, CharSequence)
  512. boolean startsWith(String)
  513. String substring(int, int)
  514. char[] toCharArray()
  515. String trim()
  516. -----
  517. -----
  518. NumberFormatException extends Exception
  519. <init>()
  520. -----
  521. -----
  522. Void extends Object
  523. -----
  524. [float]
  525. ==== Utility Classes
  526. -----
  527. Math
  528. static double abs(double)
  529. static float fabs(float)
  530. static long labs(long)
  531. static int iabs(int)
  532. static double acos(double)
  533. static double asin(double)
  534. static double atan(double)
  535. static double atan2(double)
  536. static double cbrt(double)
  537. static double ceil(double)
  538. static double cos(double)
  539. static double cosh(double)
  540. static double exp(double)
  541. static double expm1(double)
  542. static double floor(double)
  543. static double hypt(double, double)
  544. static double abs(double)
  545. static double log(double)
  546. static double log10(double)
  547. static double log1p(double)
  548. static double max(double, double)
  549. static float fmax(float, float)
  550. static long lmax(long, long)
  551. static int imax(int, int)
  552. static double min(double, double)
  553. static float fmin(float, float)
  554. static long lmin(long, long)
  555. static int imin(int, int)
  556. static double pow(double, double)
  557. static double random()
  558. static double rint(double)
  559. static long round(double)
  560. static double sin(double)
  561. static double sinh(double)
  562. static double sqrt(double)
  563. static double tan(double)
  564. static double tanh(double)
  565. static double toDegrees(double)
  566. static double toRadians(double)
  567. -----
  568. -----
  569. Utility
  570. static boolean NumberToboolean(Number)
  571. static char NumberTochar(Number)
  572. static Boolean NumberToBoolean(Number)
  573. static Short NumberToShort(Number)
  574. static Character NumberToCharacter(Number)
  575. static Integer NumberToInteger(Number)
  576. static Long NumberToLong(Number)
  577. static Float NumberToFloat(Number)
  578. static Double NumberToDouble(Number)
  579. static byte booleanTobyte(boolean)
  580. static short booleanToshort(boolean)
  581. static char booleanTochar(boolean)
  582. static int booleanToint(boolean)
  583. static long booleanTolong(boolean)
  584. static float booleanTofloat(boolean)
  585. static double booleanTodouble(boolean)
  586. static Integer booleanToInteger(boolean)
  587. static byte BooleanTobyte(Boolean)
  588. static short BooleanToshort(Boolean)
  589. static char BooleanTochar(Boolean)
  590. static int BooleanToint(Boolean)
  591. static long BooleanTolong(Boolean)
  592. static float BooleanTofloat(Boolean)
  593. static double BooleanTodouble(Boolean)
  594. static Byte BooleanToByte(Boolean)
  595. static Short BooleanToShort(Boolean)
  596. static Character BooleanToCharacter(Boolean)
  597. static Integer BooleanToInteger(Boolean)
  598. static Long BooleanToLong(Boolean)
  599. static Float BooleanToFloat(Boolean)
  600. static Double BooleanToDouble(Boolean)
  601. static boolean byteToboolean(byte)
  602. static Short byteToShort(byte)
  603. static Character byteToCharacter(byte)
  604. static Integer byteToInteger(byte)
  605. static Long byteToLong(byte)
  606. static Float byteToFloat(byte)
  607. static Double byteToDouble(byte)
  608. static boolean ByteToboolean(Byte)
  609. static char ByteTochar(Byte)
  610. static boolean shortToboolean(short)
  611. static Byte shortToByte(short)
  612. static Character shortToCharacter(short)
  613. static Integer shortToInteger(short)
  614. static Long shortToLong(short)
  615. static Float shortToFloat(short)
  616. static Double shortToDouble(short)
  617. static boolean ShortToboolean(Short)
  618. static char ShortTochar(Short)
  619. static boolean charToboolean(char)
  620. static Byte charToByte(char)
  621. static Short charToShort(char)
  622. static Integer charToInteger(char)
  623. static Long charToLong(char)
  624. static Float charToFloat(char)
  625. static Double charToDouble(char)
  626. static boolean CharacterToboolean(Character)
  627. static byte CharacterTobyte(Character)
  628. static short CharacterToshort(Character)
  629. static int CharacterToint(Character)
  630. static long CharacterTolong(Character)
  631. static float CharacterTofloat(Character)
  632. static double CharacterTodouble(Character)
  633. static Boolean CharacterToBoolean(Character)
  634. static Byte CharacterToByte(Character)
  635. static Short CharacterToShort(Character)
  636. static Integer CharacterToInteger(Character)
  637. static Long CharacterToLong(Character)
  638. static Float CharacterToFloat(Character)
  639. static Double CharacterToDouble(Character)
  640. static boolean intToboolean(int)
  641. static Byte intToByte(int)
  642. static Short intToShort(int)
  643. static Character intToCharacter(int)
  644. static Long intToLong(int)
  645. static Float intToFloat(int)
  646. static Double intToDouble(int)
  647. static boolean IntegerToboolean(Integer)
  648. static char IntegerTochar(Integer)
  649. static boolean longToboolean(long)
  650. static Byte longToByte(long)
  651. static Short longToShort(long)
  652. static Character longToCharacter(long)
  653. static Integer longToInteger(long)
  654. static Float longToFloat(long)
  655. static Double longToDouble(long)
  656. static boolean LongToboolean(Long)
  657. static char LongTochar(Long)
  658. static boolean floatToboolean(float)
  659. static Byte floatToByte(float)
  660. static Short floatToShort(float)
  661. static Character floatToCharacter(float)
  662. static Integer floatToInteger(float)
  663. static Long floatToLong(float)
  664. static Double floatToDouble(float)
  665. static boolean FloatToboolean(Float)
  666. static char FloatTochar(Float)
  667. static boolean doubleToboolean(double)
  668. static Byte doubleToByte(double)
  669. static Short doubleToShort(double)
  670. static Character doubleToCharacter(double)
  671. static Integer doubleToInteger(double)
  672. static Long doubleToLong(double)
  673. static Float doubleToFloat(double)
  674. static boolean DoubleToboolean(Double)
  675. static char DoubleTochar(Double)
  676. -----
  677. -----
  678. Def
  679. static boolean defToboolean(def)
  680. static byte defTobyte(def)
  681. static short defToshort(def)
  682. static char defTochar(def)
  683. static int defToint(def)
  684. static long defTolong(def)
  685. static float defTofloat(def)
  686. static double defTodouble(def)
  687. static Boolean defToBoolean(def)
  688. static Byte defToByte(def)
  689. static Character defToCharacter(def)
  690. static Integer defToInteger(def)
  691. static Long defToLong(def)
  692. static Float defToFloat(def)
  693. static Double defToDouble(def)
  694. -----