Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all arity-specific methods are broken #78

Merged
merged 3 commits into from
Jun 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 32 additions & 33 deletions src/main/java/com/bio4j/angulillos/TypedVertex.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ <X> V set(Property<VT,X> property, X value) {

/* #### Outgoing edges */
default <
E extends TypedEdge<V,VT, E,ET, ?,?, ?,RV,RE>,
ET extends TypedEdge.Type<V,VT, E,ET, ?,?, ?,RV,RE>
E extends TypedEdge<V,VT, E,?, ?,?, ?,RV,RE>,
ET extends TypedEdge.Type<V,VT, E,?, ?,?, ?,RV,RE>
>
Stream<E> outE(ET edgeType) {

Expand All @@ -83,8 +83,8 @@ Stream<E> outE(ET edgeType) {
}

default <
E extends TypedEdge<V,VT, E,ET, ?,?, ?,RV,RE>,
ET extends TypedEdge.Type<V,VT, E,ET, ?,?, ?,RV,RE>
E extends TypedEdge<V,VT, E,?, ?,?, ?,RV,RE>,
ET extends TypedEdge.Type<V,VT, E,?, ?,?, ?,RV,RE>
& Arity.ToAtLeastOne
>
Stream<E> outAtLeastOneE(ET edgeType) {
Expand All @@ -98,8 +98,8 @@ Stream<E> outAtLeastOneE(ET edgeType) {
}

default <
E extends TypedEdge<V,VT, E,ET, ?,?, ?,RV,RE>,
ET extends TypedEdge.Type<V,VT, E,ET, ?,?, ?,RV,RE>
E extends TypedEdge<V,VT, E,?, ?,?, ?,RV,RE>,
ET extends TypedEdge.Type<V,VT, E,?, ?,?, ?,RV,RE>
& Arity.ToAtMostOne
>
Optional<E> outAtMostOneE(ET edgeType) {
Expand All @@ -113,8 +113,8 @@ Optional<E> outAtMostOneE(ET edgeType) {
}

default <
E extends TypedEdge<V,VT, E,ET, ?,?, ?,RV,RE>,
ET extends TypedEdge.Type<V,VT, E,ET, ?,?, ?,RV,RE>
E extends TypedEdge<V,VT, E,?, ?,?, ?,RV,RE>,
ET extends TypedEdge.Type<V,VT, E,?, ?,?, ?,RV,RE>
& Arity.ToOne
>
E outOneE(ET edgeType) {
Expand All @@ -130,8 +130,8 @@ E outOneE(ET edgeType) {

/* #### Incoming edges */
default <
E extends TypedEdge<?,?, E,ET, V,VT, ?,RV,RE>,
ET extends TypedEdge.Type<?,?, E,ET, V,VT, ?,RV,RE>
E extends TypedEdge<?,?, E,?, V,VT, ?,RV,RE>,
ET extends TypedEdge.Type<?,?, E,?, V,VT, ?,RV,RE>
>
Stream<E> inE(ET edgeType) {

Expand All @@ -144,8 +144,8 @@ Stream<E> inE(ET edgeType) {
}

default <
E extends TypedEdge<?,?, E,ET, V,VT, ?,RV,RE>,
ET extends TypedEdge.Type<?,?, E,ET, V,VT, ?,RV,RE>
E extends TypedEdge<?,?, E,?, V,VT, ?,RV,RE>,
ET extends TypedEdge.Type<?,?, E,?, V,VT, ?,RV,RE>
& Arity.FromAtLeastOne
>
Stream<E> inAtLeastOneE(ET edgeType) {
Expand All @@ -159,8 +159,8 @@ Stream<E> inAtLeastOneE(ET edgeType) {
}

default <
E extends TypedEdge<?,?, E,ET, V,VT, ?,RV,RE>,
ET extends TypedEdge.Type<?,?, E,ET, V,VT, ?,RV,RE>
E extends TypedEdge<?,?, E,?, V,VT, ?,RV,RE>,
ET extends TypedEdge.Type<?,?, E,?, V,VT, ?,RV,RE>
& Arity.FromAtMostOne
>
Optional<E> inAtMostOneE(ET edgeType) {
Expand All @@ -174,8 +174,8 @@ Optional<E> inAtMostOneE(ET edgeType) {
}

default <
E extends TypedEdge<?,?, E,ET, V,VT, ?,RV,RE>,
ET extends TypedEdge.Type<?,?, E,ET, V,VT, ?,RV,RE>
E extends TypedEdge<?,?, E,?, V,VT, ?,RV,RE>,
ET extends TypedEdge.Type<?,?, E,?, V,VT, ?,RV,RE>
& Arity.FromOne
>
E inOneE(ET edgeType) {
Expand All @@ -193,8 +193,8 @@ E inOneE(ET edgeType) {

/* #### Outgoing vertices */
default <
E extends TypedEdge<V,VT, E,ET, T,TT, ?,RV,RE>,
ET extends TypedEdge.Type<V,VT, E,ET, T,TT, ?,RV,RE>,
E extends TypedEdge<V,VT, E,?, T,TT, ?,RV,RE>,
ET extends TypedEdge.Type<V,VT, E,?, T,TT, ?,RV,RE>,
T extends TypedVertex<T,TT, ?,RV,RE>,
TT extends TypedVertex.Type<T,TT, ?,RV,RE>
>
Expand All @@ -209,8 +209,8 @@ Stream<T> outV(ET edgeType) {
}

default <
E extends TypedEdge<V,VT, E,ET, T,TT, ?,RV,RE>,
ET extends TypedEdge.Type<V,VT, E,ET, T,TT, ?,RV,RE>
E extends TypedEdge<V,VT, E,?, T,TT, ?,RV,RE>,
ET extends TypedEdge.Type<V,VT, E,?, T,TT, ?,RV,RE>
& Arity.ToAtLeastOne,
T extends TypedVertex<T,TT, ?,RV,RE>,
TT extends TypedVertex.Type<T,TT, ?,RV,RE>
Expand All @@ -226,8 +226,8 @@ Stream<T> outAtLeastOneV(ET edgeType) {
}

default <
E extends TypedEdge<V,VT, E,ET, T,TT, ?,RV,RE>,
ET extends TypedEdge.Type<V,VT, E,ET, T,TT, ?,RV,RE>
E extends TypedEdge<V,VT, E,?, T,TT, ?,RV,RE>,
ET extends TypedEdge.Type<V,VT, E,?, T,TT, ?,RV,RE>
& Arity.ToAtMostOne,
T extends TypedVertex<T,TT, ?,RV,RE>,
TT extends TypedVertex.Type<T,TT, ?,RV,RE>
Expand All @@ -243,8 +243,8 @@ Optional<T> outAtMostOneV(ET edgeType) {
}

default <
E extends TypedEdge<V,VT, E,ET, T,TT, ?,RV,RE>,
ET extends TypedEdge.Type<V,VT, E,ET, T,TT, ?,RV,RE>
E extends TypedEdge<V,VT, E,?, T,TT, ?,RV,RE>,
ET extends TypedEdge.Type<V,VT, E,?, T,TT, ?,RV,RE>
& Arity.ToOne,
T extends TypedVertex<T,TT, ?,RV,RE>,
TT extends TypedVertex.Type<T,TT, ?,RV,RE>
Expand All @@ -264,8 +264,8 @@ T outOneV(ET edgeType) {
default <
S extends TypedVertex<S,ST, ?,RV,RE>,
ST extends TypedVertex.Type<S,ST, ?,RV,RE>,
E extends TypedEdge<S,ST, E,ET, V,VT, ?,RV,RE>,
ET extends TypedEdge.Type<S,ST, E,ET, V,VT, ?,RV,RE>
E extends TypedEdge<S,ST, E,?, V,VT, ?,RV,RE>,
ET extends TypedEdge.Type<S,ST, E,?, V,VT, ?,RV,RE>
>
Stream<S> inV(ET edgeType) {

Expand All @@ -280,8 +280,8 @@ Stream<S> inV(ET edgeType) {
default <
S extends TypedVertex<S,ST, ?,RV,RE>,
ST extends TypedVertex.Type<S,ST, ?,RV,RE>,
E extends TypedEdge<S,ST, E,ET, V,VT, ?,RV,RE>,
ET extends TypedEdge.Type<S,ST, E,ET, V,VT, ?,RV,RE>
E extends TypedEdge<S,ST, E,?, V,VT, ?,RV,RE>,
ET extends TypedEdge.Type<S,ST, E,?, V,VT, ?,RV,RE>
& Arity.FromAtLeastOne
>
Stream<S> inAtLeastOneV(ET edgeType) {
Expand All @@ -297,8 +297,8 @@ Stream<S> inAtLeastOneV(ET edgeType) {
default <
S extends TypedVertex<S,ST, ?,RV,RE>,
ST extends TypedVertex.Type<S,ST, ?,RV,RE>,
E extends TypedEdge<S,ST, E,ET, V,VT, ?,RV,RE>,
ET extends TypedEdge.Type<S,ST, E,ET, V,VT, ?,RV,RE>
E extends TypedEdge<S,ST, E,?, V,VT, ?,RV,RE>,
ET extends TypedEdge.Type<S,ST, E,?, V,VT, ?,RV,RE>
& Arity.FromAtMostOne
>
Optional<S> inAtMostOneV(ET edgeType) {
Expand All @@ -314,9 +314,8 @@ Optional<S> inAtMostOneV(ET edgeType) {
default <
S extends TypedVertex<S,ST, ?,RV,RE>,
ST extends TypedVertex.Type<S,ST, ?,RV,RE>,
E extends TypedEdge<S,ST, E,ET, V,VT, ?,RV,RE>,
ET extends TypedEdge.Type<S,ST, E,ET, V,VT, ?,RV,RE>
& Arity.FromOne
E extends TypedEdge<S,ST, E,?, V,VT, ?,RV,RE>,
ET extends Arity.FromOne & TypedEdge.Type<S,ST, E,?, V,VT, ?,RV,RE>
>
S inOneV(ET edgeType) {

Expand Down
14 changes: 9 additions & 5 deletions src/test/java/com/bio4j/angulillos/TwitterGraphTestSuite.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import java.util.Date;
import java.net.URL;

import com.bio4j.angulillos.*;

public abstract class TwitterGraphTestSuite<RV,RE> {

protected Twitter<RV,RE> g;
Expand Down Expand Up @@ -75,11 +77,13 @@ public abstract class TwitterGraphTestSuite<RV,RE> {
// );
// }
//
// /* This uses arity-specific methods to return **the** user that tweeted a tweet. */
// public Twitter<RV,RE>.User tweeted(Twitter<RV,RE>.Tweet tweet) {
//
// return tweet.inOneV(g.posted);
// }

// see #78
/* This uses arity-specific methods to return **the** user that tweeted a tweet. */
public Twitter<RV,RE>.User tweeted(Twitter<RV,RE>.Tweet tweet) {

return tweet.inOneV(g.posted);
}
//
// public Stream<Twitter<RV,RE>.User> repliedToSomeTweetFrom(Twitter<RV,RE>.User user) {
//
Expand Down