Commit Graph

2654 Commits

Author SHA1 Message Date
James Strachan 8299ffa690 implemented Stepan's excellent suggestion of a cleaner computeNext() method on AbstractIterator to make a little easier to implement clean iterators - and avoid pesky nulls in the process 2012-03-30 11:08:01 +01:00
Svetlana Isakova d4d177c0ed added 'public' annotation to library functions 2012-03-30 13:38:36 +04:00
Svetlana Isakova 167a9c444a Added 'public' annotation and specified return types for library functions 2012-03-30 13:38:35 +04:00
James Strachan fbd1279cc9 removed Iterator.toString() as it changes the iterator state, the default is fine and folks should be explicit about iterating over an iterator. Also disabled the default limit on the iterator on join(); if folks want to limit the join they should be explicit 2012-03-30 10:24:27 +01:00
James Strachan 2f1ceba317 Merge pull request #33 from franckrasolo/stdlib
#KT-1650 Fixed
2012-03-29 06:18:06 -07:00
James Strachan 338638d4f5 first spike of fix for KT-1668 to help github syntax highlighter; will rename more when Franck is done with his patches on the collection stuff 2012-03-29 09:32:56 +01:00
Franck Rasolo 834c624f2c KT-1650 Made map and all variations of filter return List<T> for Java iterables, implemented take/takeWhile, and tidied up KDoc comments accordingly, #KT-1650 Fixed 2012-03-28 19:46:12 +01:00
Franck Rasolo ca4f552245 KT-1653 Implemented map, flatMap, take, takeWhile, join, and toString for iterators, #KT-1653 Fixed 2012-03-28 15:55:27 +01:00
James Strachan fe9d5ddf89 fixed up the code generator after moving stuff around and updated with the latest/greatest documentation and function includes 2012-03-27 12:48:37 +01:00
James Strachan 133afa8327 link more documentation to test cases and filled out the test cases a little 2012-03-27 12:26:20 +01:00
James Strachan 31fd665913 added more links to test code inside the kdoc and tidied up the tests a little so they look a bit nicer and more self contained in the documentation 2012-03-27 11:33:05 +01:00
James Strachan a1cde5a7aa moved the source of the standard library so that the source files (other than generated stuff) are in the package hierarchy so its easier to navigate the source of the standard library 2012-03-27 10:58:01 +01:00
James Strachan 7dd8bc9911 allow comments to include source code from test methods to demonstrate an API in action in code thats actually tested to be accurate. #KT-1458 Fixed 2012-03-27 10:46:08 +01:00
James Strachan 5c7ee4d870 added lazy message versions of require/assert/check methods, #KT-693 fixed 2012-03-27 06:16:21 +01:00
James Strachan 7aef088f7b added a test of list sorting using a hand crafted Comparator<T>; though using the comparator function would be nice when KT-729 is fixed 2012-03-26 22:30:28 +01:00
James Strachan 5ece48e3cc show traits and class visibility properly in kdoc and hide non API stuff (i.e. public and protected is shown) 2012-03-26 17:07:23 +01:00
James Strachan 1c36fdf23c use more concise way to create a comparator 2012-03-26 15:17:19 +01:00
James Strachan 2803dfca08 tidied up the compareBy helper function a little; only compare based on the functions given 2012-03-26 15:07:34 +01:00
James Strachan 5b252aaf39 added sample comparator code and tidied up some test cases & converted them to the cleaner JUnit 4 style 2012-03-26 11:43:25 +01:00
James Strachan dcae0277f1 updated the comments a little 2012-03-26 10:56:51 +01:00
James Strachan d8c3a8f55c added a couple of helper functions to make it easier to compare values, implement Comparable and create Comparators 2012-03-26 10:53:39 +01:00
James Strachan 3a4ed6a85f for consistency, moved extension functions on iterator/iterable/collection to the kotlin package rather than being split across kotlin and kotlin.util. Once intrinsic collections are here we could consider moving the java.util extension functions into kotlin.java.util 2012-03-26 08:59:16 +01:00
Andrey Breslav dd9c36387c KT-987 Unboxing nulls
#KT-987 Fixed
2012-03-26 11:42:34 +04:00
James Strachan a194764657 added a helper method for converting functions into iterators (which have all the various standard library APIs on them) 2012-03-25 08:10:17 +01:00
James Strachan 85bf6dc5a7 fixed up setting the text on an element 2012-03-24 21:45:55 +00:00
James Strachan b688ff4a7c thanks to the heads up from Franck, I can work around KT-1646 - refactored previous Filter code to reuse the AbstractIterator base class and implemented filter/filterNot/filterIsInstance lazily 2012-03-24 21:14:54 +00:00
James Strachan e45cb714ab added test case for KT-1646 in an attempt to implement lazy filter/flatMap for Iterator 2012-03-24 20:29:11 +00:00
Andrey Breslav aae196839e Reverting the pull-request #29 due to the upcoming redesign of the lazy collections API 2012-03-23 18:11:08 +01:00
James Strachan a18830ef29 working filterIsInstance() helper method for filtering on a sub type 2012-03-23 15:31:43 +00:00
James Strachan dadd288c40 switch to using an enum 2012-03-23 15:31:12 +00:00
James Strachan 23e563b826 initial spike at implementing the standard collection functions on iterators; though compiler error prevented me from implementing all the lazy functions just yet 2012-03-23 11:36:11 +00:00
James Strachan 19cdb782ac added helper methods for iterating through next/previous nodes or elements on the DOM 2012-03-23 11:04:51 +00:00
James Strachan b2dd4cd590 updated the code generator of standard library methods and regenerated it 2012-03-23 11:04:04 +00:00
James Strachan c0cac21b8a added a helper method to filter a subset of an iterator by sub type 2012-03-23 11:03:38 +00:00
James Strachan b46bb17377 corrected type of OutputStream.buffered() and fail if UTF-8 default charset can't be found - thanks for the heads up Stepan! :) 2012-03-22 07:20:26 +00:00
James Strachan 2e50a2332c used functions rather that properties for consistency on streams.reader/writer/buffered methods; also use UTF-8 charset by default 2012-03-21 20:37:44 +00:00
Evgeny Goldin 01679d315d Cleanup - "localKotlin" profile is eliminated, it is now the default behavior 2012-03-21 15:21:12 +01:00
Evgeny Goldin 9caca33ac6 testFilterIntoLinkedList test uncommented; Maven dependencies update 2012-03-21 15:12:00 +01:00
Franck Rasolo 32d44ef58b Merge remote branch 'upstream/master' 2012-03-21 10:27:47 +00:00
Franck Rasolo ef89a38de1 Added sequences that helped solve Project Euler problems 2012-03-21 10:27:17 +00:00
James Strachan e740c47e29 removed some of the cruft and redundant copies of junit.jar 2012-03-21 09:09:09 +00:00
Franck Rasolo fe17d83493 Initial implementation of lazily evaluated sequences 2012-03-21 01:31:41 +00:00
Evgeny Goldin 669c7ec326 Libraries:
- "kotlin-maven-plugin" is pulled up to the main POM
 - "testFilterIntoLinkedList" test commented out
 - stdlib - including "kotlin-runtime" respects "localKotlin" profile
2012-03-20 21:54:43 +01:00
James Strachan 01ca558898 re-enabled some more tests for check; still need KT-1540 fixed to be able to use the assert function though 2012-03-20 16:15:42 +00:00
James Strachan 381c135fbd added writer helper methods to InputStream 2012-03-20 15:25:05 +00:00
James Strachan 5bcef67dfe added test cases for KT-1619 and KT-1617 2012-03-20 12:03:54 +00:00
Evgeny Goldin 178d822c89 Added "kotlin-maven-plugin" module, extracted <junit> to the parent POM scope "compile". 2012-03-19 23:19:23 +01:00
Stepan Koltsov e2cb98df67 better import jet namespace 2012-03-19 23:25:27 +04:00
James Strachan 1c408cdbda include the runtime classes in the mvn build stdlib 2012-03-19 17:13:56 +00:00
James Strachan 8654e67b29 Merge pull request #26 from ae6rt/master
sorted set from Mark Petrovic merged with thanks!
2012-03-19 02:07:56 -07:00