File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2306,6 +2306,23 @@ class NumberWrapperBase {
23062306 String toString () const { return String (::std::to_string (v)); }
23072307};
23082308
2309+ // Java Collections and Arrays -- minimal stubs
2310+ class Collections {
2311+ public:
2312+ template <class T > static void sort (::std::vector<T>& v) { ::std::sort (v.begin (),v.end ()); }
2313+ template <class T > static void reverse (::std::vector<T>& v) { ::std::reverse (v.begin (),v.end ()); }
2314+ template <class T > static void shuffle (::std::vector<T>& v) { ::std::shuffle (v.begin (),v.end (),::std::default_random_engine (rand ())); }
2315+ template <class T > static T min (const ::std::vector<T>& v) { return *::std::min_element (v.begin (),v.end ()); }
2316+ template <class T > static T max (const ::std::vector<T>& v) { return *::std::max_element (v.begin (),v.end ()); }
2317+ };
2318+ class Arrays {
2319+ public:
2320+ template <class T > static void sort (::std::vector<T>& v) { ::std::sort (v.begin (),v.end ()); }
2321+ template <class T > static ::std::string toString (const ::std::vector<T>& v) {
2322+ ::std::string s=" [" ; for (int i=0 ;i<(int )v.size ();i++){if (i)s+=" , " ;s+=::std::to_string (v[i]);} return s+" ]" ;
2323+ }
2324+ };
2325+
23092326// Java System class -- minimal stub for sketches that use System.currentTimeMillis() etc.
23102327class System {
23112328public:
You can’t perform that action at this time.
0 commit comments