Skip to content

Commit

Permalink
Operator renames, Gradle properties
Browse files Browse the repository at this point in the history
  • Loading branch information
akarnokd committed Jun 13, 2014
1 parent 84e2010 commit eedbe08
Show file tree
Hide file tree
Showing 9 changed files with 340 additions and 419 deletions.
15 changes: 15 additions & 0 deletions .gitattributes
@@ -0,0 +1,15 @@
# Set default behaviour, in case users don't have core.autocrlf set.
* text=auto

# Explicitly declare text files we want to always be normalized and converted
# to native line endings on checkout.
*.java text
*.groovy text
*.scala text
*.clj text
*.txt text
*.md text

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
14 changes: 14 additions & 0 deletions build.gradle
Expand Up @@ -21,12 +21,16 @@ repositories {
// http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:repositories
}

apply plugin: 'maven'
apply plugin: 'osgi'

dependencies {
// TODO: Add dependencies here ...
compile "com.netflix.rxjava:rxjava-core:0.19.1"
// You can read more about how to add dependency here:
// http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:how_to_declare_your_dependencies
testCompile group: 'junit', name: 'junit', version: '4.10'
testCompile 'org.mockito:mockito-core:1.8.5'
}

task sourcesJar(type: Jar, dependsOn: classes) {
Expand All @@ -42,4 +46,14 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
artifacts {
archives sourcesJar
archives javadocJar
}

jar {
manifest {
name = 'ixjava'
instruction 'Bundle-Vendor', 'akarnokd'
instruction 'Bundle-DocURL', 'https://github.com/akarnokd/ixjava'
instruction 'Import-Package', '!org.junit,!junit.framework,!org.mockito.*,*'
instruction 'Eclipse-ExtensibleAPI', 'true'
}
}
1 change: 1 addition & 0 deletions gradle.properties
@@ -0,0 +1 @@
version=0.10.0
2 changes: 1 addition & 1 deletion settings.gradle
@@ -1 +1 @@
rootProject.name = 'ixjava-experiment'
rootProject.name = 'ixjava'
42 changes: 37 additions & 5 deletions src/main/java/ix/GroupedIterable.java
Expand Up @@ -15,13 +15,45 @@
*/
package ix;

import java.util.LinkedList;
import java.util.List;

/**
* The extension interface to an iterable which
* holds a group key for its contents.
* Contains a sequence values with an associated key used by the groupBy operator.
* @param <K> the group key type
* @param <V> the value type
*/
public interface GroupedIterable<K, V> extends Iterable<V> {
/** @return the key of this iterable. */
K key();
public final class GroupedIterable<K, V> extends Iterables<V> {
/** The group key. */
protected final K key;
/** The values in the group. */
protected final List<V> values;
/**
* Constructs a new grouped iterable with the given key.
* @param key the group key
*/
public GroupedIterable(K key) {
super(new LinkedList<V>());
this.key = key;
this.values = (List<V>)this.it;
}
public K getKey() {
return key;
}
/**
* Adds one element to the values.
* @param value the value
*/
public void add(V value) {
values.add(value);
}
/**
* Add the values of the target iterable.
* @param values the values to add
*/
public void add(Iterable<V> values) {
for (V v : values) {
this.values.add(v);
}
}
}

0 comments on commit eedbe08

Please sign in to comment.