Changeset 240 for cpp/frams/vm/classes/collectionobj.cpp
- Timestamp:
- 04/30/14 20:25:32 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/vm/classes/collectionobj.cpp
r197 r240 19 19 "Example:\nvar v=Vector.new();\nv.add(123); v.add(\"string\");",}, 20 20 {"clear",0,PARAM_NOSTATIC,"clear data","p()",PROCEDURE(p_clear),}, 21 {"size",0,PARAM_READONLY +PARAM_NOSTATIC,"element count","d",GETONLY(size),},21 {"size",0,PARAM_READONLY | PARAM_NOSTATIC,"element count","d",GETONLY(size),}, 22 22 {"remove",0,PARAM_NOSTATIC,"remove at position","p(d position)",PROCEDURE(p_remove),}, 23 23 {"get",0,PARAM_NOSTATIC,"get value at position","p x(d position)",PROCEDURE(p_get),}, … … 25 25 {"add",0,PARAM_NOSTATIC,"append at the end","p(x value)",PROCEDURE(p_add),}, 26 26 {"find",0,PARAM_NOSTATIC,"find","p d(x value)",PROCEDURE(p_find),"returns the element index or -1 if not found"}, 27 {"avg",0,PARAM_READONLY +PARAM_NOSTATIC,"average","f",GETONLY(avg)},28 {"stdev",0,PARAM_READONLY +PARAM_NOSTATIC,"standard deviation","f",GETONLY(stdev),"=sqrt(sum((element[i]-avg)^2)/(size-1)) which is estimated population std.dev. from sample std.dev."},29 {"toString",0,PARAM_READONLY +PARAM_NOSTATIC,"textual form","s",GETONLY(toString),},27 {"avg",0,PARAM_READONLY | PARAM_NOSTATIC,"average","f",GETONLY(avg)}, 28 {"stdev",0,PARAM_READONLY | PARAM_NOSTATIC,"standard deviation","f",GETONLY(stdev),"=sqrt(sum((element[i]-avg)^2)/(size-1)) which is estimated population std.dev. from sample std.dev."}, 29 {"toString",0,PARAM_READONLY | PARAM_NOSTATIC,"textual form","s",GETONLY(toString),}, 30 30 {"new",0,0,"create new Vector","p oVector()",STATICPROCEDURE(p_new),}, 31 31 {"sort",0,PARAM_NOSTATIC,"sort elements (in place)","p(o comparator)",PROCEDURE(p_sort),"comparator can be null, giving the \"natural\" sorting order (depending on element type), otherwise it must be a function reference obtained by the \"function FUNCTIONNAME\" operator.\n\nExample:\nfunction compareLastDigit(a,b) {return (a%10)<(b%10);}\nvar v=[16,23,35,42,54,61];\nv.sort(function compareLastDigit);"}, 32 {"iterator",0,PARAM_NOSTATIC +PARAM_READONLY,"iterator","o",GETONLY(iterator),},32 {"iterator",0,PARAM_NOSTATIC | PARAM_READONLY,"iterator","o",GETONLY(iterator),}, 33 33 {0,0,0,}, 34 34 }; … … 44 44 "var i;\nfor(i=0;i<d.size;i++) Simulator.print(d.getKey(i)+\" is \"+d.get(i));",}, 45 45 {"clear",0,PARAM_NOSTATIC,"clear data","p()",PROCEDURE(p_clear),}, 46 {"size",0,PARAM_NOSTATIC +PARAM_READONLY,"element count","d",GETONLY(size),},46 {"size",0,PARAM_NOSTATIC | PARAM_READONLY,"element count","d",GETONLY(size),}, 47 47 {"remove",0,PARAM_NOSTATIC,"remove named or indexed element","p(x key)",PROCEDURE(p_remove),}, 48 48 {"get",0,PARAM_NOSTATIC,"get named or indexed element","p x(x key)",PROCEDURE(p_get),}, … … 51 51 {"find",0,PARAM_NOSTATIC,"find","p s(x value)",PROCEDURE(p_find),"returns the element key or null if not found"}, 52 52 {"new",0,0,"create new Dictionary","p oDictionary()",STATICPROCEDURE(p_new),}, 53 {"toString",0,PARAM_READONLY +PARAM_NOSTATIC,"textual form","s",GETONLY(toString),},53 {"toString",0,PARAM_READONLY | PARAM_NOSTATIC,"textual form","s",GETONLY(toString),}, 54 54 {0,0,0,}, 55 55 }; … … 442 442 { 443 443 {"VectorIterator",1,2,"VectorIterator","VectorIterator"}, 444 {"next",0,PARAM_READONLY +PARAM_NOSTATIC,"next","d 0 1",GETONLY(next),},445 {"value",0,PARAM_READONLY +PARAM_NOSTATIC,"value","x",GETONLY(value),},444 {"next",0,PARAM_READONLY | PARAM_NOSTATIC,"next","d 0 1",GETONLY(next),}, 445 {"value",0,PARAM_READONLY | PARAM_NOSTATIC,"value","x",GETONLY(value),}, 446 446 {0,0,0,}, 447 447 };
Note: See TracChangeset
for help on using the changeset viewer.