rubycollect4j Icon

rubycollect4j

Ruby Collections for Java

Add a Review
0 Downloads (This Week)
Last Update:
  Browse Code Git Repository

Description

The rubycollect4j implements all methods refer to Ruby Array, Hash and Enumerable.

For further info, please visit http://ruby-doc.org website.

For more documentation, please read JavaDoc.

With Java 8:
// Sort the characters by its frequency based on the word 'Mississippi' case-insensitively
RubyArray<String> word = ra("Mississippi".split("(?!^)"));

String result = word.map((c) -> {
return c.toLowerCase();
}).sortBy((c) -> {
return word.count(c);
}).uniq().join();

p(result); // "mpis"

With Java 6:
// Sort the characters by its frequency based on the word 'Mississippi' case-insensitively
final RubyArray<String> word = newRubyArray("Mississippi".split("(?!^)"));

String result = word.map(new TransformBlock<String, String>() {
public String yield(String c) {
return c.toLowerCase();
}
}).sortBy(new TransformBlock<String, Integer>() {
public Integer yield(String c) {
return word.count(c);
}
}).uniq().join();

p(result); // "mpis"

rubycollect4j Web Site

Categories

Libraries

License

Apache License V2.0

KEEP ME UPDATED

Write a Review

User Reviews

Be the first to post a review of rubycollect4j!

Additional Project Details

Intended Audience

Developers

Programming Language

Java

Registered

2013-06-17

Thanks for helping keep SourceForge clean.

Screenshot instructions:
Windows
Mac
Red Hat Linux   Ubuntu

Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies
X

Briefly describe the problem (required):

Upload screenshot of ad (required):
Select a file, or drag & drop file here.

Please provide the ad click URL, if possible:

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks