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

Fix RVT, RET types to Strings #51

Merged
merged 1 commit into from
Mar 20, 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
6 changes: 3 additions & 3 deletions src/main/java/com/bio4j/angulillos/Property.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
*/
interface Property <
// the element type
N extends TypedElement<N,NT,G,I,RV,RVT,RE,RET>, NT extends TypedElement.Type<N,NT,G,I,RV,RVT,RE,RET>,
N extends TypedElement<N,NT,G,I,RV,RE>, NT extends TypedElement.Type<N,NT,G,I,RV,RE>,
// the property type and its value type
P extends Property<N,NT,P,V,G,I,RV,RVT,RE,RET>, V,
P extends Property<N,NT,P,V,G,I,RV,RE>, V,
// graph
G extends TypedGraph<G,I,RV,RVT,RE,RET>, I extends UntypedGraph<RV,RVT,RE,RET>, RV,RVT, RE,RET
G extends TypedGraph<G,I,RV,RE>, I extends UntypedGraph<RV,RE>, RV,RE
>
{

Expand Down
50 changes: 24 additions & 26 deletions src/main/java/com/bio4j/angulillos/TypedEdge.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
*/
interface TypedEdge <
// src
S extends TypedVertex<S,ST,SG,I,RV,RVT,RE,RET>,
ST extends TypedVertex.Type<S,ST,SG,I,RV,RVT,RE,RET>,
SG extends TypedGraph<SG,I,RV,RVT,RE,RET>,
S extends TypedVertex<S,ST,SG,I,RV,RE>,
ST extends TypedVertex.Type<S,ST,SG,I,RV,RE>,
SG extends TypedGraph<SG,I,RV,RE>,
// rel
R extends TypedEdge<S,ST,SG,R,RT,RG,I,RV,RVT,RE,RET,T,TT,TG>,
RT extends TypedEdge.Type<S,ST,SG,R,RT,RG,I,RV,RVT,RE,RET,T,TT,TG>,
RG extends TypedGraph<RG,I,RV,RVT,RE,RET>,
I extends UntypedGraph<RV,RVT,RE,RET>, RV,RVT, RE,RET,
R extends TypedEdge<S,ST,SG,R,RT,RG,I,RV,RE,T,TT,TG>,
RT extends TypedEdge.Type<S,ST,SG,R,RT,RG,I,RV,RE,T,TT,TG>,
RG extends TypedGraph<RG,I,RV,RE>,
I extends UntypedGraph<RV,RE>, RV,RE,
// tgt
T extends TypedVertex<T,TT,TG,I,RV,RVT,RE,RET>,
TT extends TypedVertex.Type<T,TT,TG,I,RV,RVT,RE,RET>,
TG extends TypedGraph<TG,I,RV,RVT,RE,RET>
T extends TypedVertex<T,TT,TG,I,RV,RE>,
TT extends TypedVertex.Type<T,TT,TG,I,RV,RE>,
TG extends TypedGraph<TG,I,RV,RE>
>
extends TypedElement<R,RT,RG,I,RV,RVT,RE,RET>
extends TypedElement<R,RT,RG,I,RV,RE>
{

/* `raw` gives you the raw edge underlying this instance; see [untyped graph](UntypedGraph.java.md) */
Expand All @@ -39,14 +39,14 @@ interface TypedEdge <

@Override
default <
P extends Property<R,RT,P,V,RG,I,RV,RVT,RE,RET>,
P extends Property<R,RT,P,V,RG,I,RV,RE>,
V
>
V get(P property) { return graph().getProperty(self(), property); }

@Override
default <
P extends Property<R,RT,P,V,RG,I,RV,RVT,RE,RET>,
P extends Property<R,RT,P,V,RG,I,RV,RE>,
V
>
R set(P property, V value) {
Expand All @@ -64,24 +64,22 @@ interface HasArity {

interface Type <
// src
S extends TypedVertex<S,ST,SG,I,RV,RVT,RE,RET>,
ST extends TypedVertex.Type<S,ST,SG,I,RV,RVT,RE,RET>,
SG extends TypedGraph<SG,I,RV,RVT,RE,RET>,
S extends TypedVertex<S,ST,SG,I,RV,RE>,
ST extends TypedVertex.Type<S,ST,SG,I,RV,RE>,
SG extends TypedGraph<SG,I,RV,RE>,
// rel
R extends TypedEdge<S,ST,SG,R,RT,RG,I,RV,RVT,RE,RET,T,TT,TG>,
RT extends TypedEdge.Type<S,ST,SG,R,RT,RG,I,RV,RVT,RE,RET,T,TT,TG>,
RG extends TypedGraph<RG,I,RV,RVT,RE,RET>,
I extends UntypedGraph<RV,RVT,RE,RET>, RV,RVT, RE,RET,
R extends TypedEdge<S,ST,SG,R,RT,RG,I,RV,RE,T,TT,TG>,
RT extends TypedEdge.Type<S,ST,SG,R,RT,RG,I,RV,RE,T,TT,TG>,
RG extends TypedGraph<RG,I,RV,RE>,
I extends UntypedGraph<RV,RE>, RV,RE,
// tgt
T extends TypedVertex<T,TT,TG,I,RV,RVT,RE,RET>,
TT extends TypedVertex.Type<T,TT,TG,I,RV,RVT,RE,RET>,
TG extends TypedGraph<TG,I,RV,RVT,RE,RET>
T extends TypedVertex<T,TT,TG,I,RV,RE>,
TT extends TypedVertex.Type<T,TT,TG,I,RV,RE>,
TG extends TypedGraph<TG,I,RV,RE>
> extends
TypedElement.Type<R,RT,RG,I,RV,RVT,RE,RET>,
TypedElement.Type<R,RT,RG,I,RV,RE>,
HasArity
{
@Override
RET raw();

ST sourceType();
TT targetType();
Expand Down
76 changes: 38 additions & 38 deletions src/main/java/com/bio4j/angulillos/TypedEdgeIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,49 +5,49 @@

interface TypedEdgeIndex <
// src
S extends TypedVertex<S,ST,SG,I,RV,RVT,RE,RET>,
ST extends TypedVertex.Type<S,ST,SG,I,RV,RVT,RE,RET>,
SG extends TypedGraph<SG,I,RV,RVT,RE,RET>,
S extends TypedVertex<S,ST,SG,I,RV,RE>,
ST extends TypedVertex.Type<S,ST,SG,I,RV,RE>,
SG extends TypedGraph<SG,I,RV,RE>,
// rel
R extends TypedEdge<S,ST,SG,R,RT,RG,I,RV,RVT,RE,RET,T,TT,TG>,
RT extends TypedEdge.Type<S,ST,SG,R,RT,RG,I,RV,RVT,RE,RET,T,TT,TG>,
R extends TypedEdge<S,ST,SG,R,RT,RG,I,RV,RE,T,TT,TG>,
RT extends TypedEdge.Type<S,ST,SG,R,RT,RG,I,RV,RE,T,TT,TG>,
// property
P extends Property<R,RT,P,V,RG,I,RV,RVT,RE,RET>,
P extends Property<R,RT,P,V,RG,I,RV,RE>,
V,
RG extends TypedGraph<RG,I,RV,RVT,RE,RET>,
I extends UntypedGraph<RV,RVT,RE,RET>, RV,RVT, RE,RET,
RG extends TypedGraph<RG,I,RV,RE>,
I extends UntypedGraph<RV,RE>, RV,RE,
// tgt
T extends TypedVertex<T,TT,TG,I,RV,RVT,RE,RET>,
TT extends TypedVertex.Type<T,TT,TG,I,RV,RVT,RE,RET>,
TG extends TypedGraph<TG,I,RV,RVT,RE,RET>
T extends TypedVertex<T,TT,TG,I,RV,RE>,
TT extends TypedVertex.Type<T,TT,TG,I,RV,RE>,
TG extends TypedGraph<TG,I,RV,RE>
>
extends
TypedElementIndex<R,RT,P,V,RG,I,RV,RVT,RE,RET>
TypedElementIndex<R,RT,P,V,RG,I,RV,RE>
{

default RT edgeType() { return elementType(); }

interface Unique <
// src
S extends TypedVertex<S,ST,SG,I,RV,RVT,RE,RET>,
ST extends TypedVertex.Type<S,ST,SG,I,RV,RVT,RE,RET>,
SG extends TypedGraph<SG,I,RV,RVT,RE,RET>,
S extends TypedVertex<S,ST,SG,I,RV,RE>,
ST extends TypedVertex.Type<S,ST,SG,I,RV,RE>,
SG extends TypedGraph<SG,I,RV,RE>,
// rel
R extends TypedEdge<S,ST,SG,R,RT,RG,I,RV,RVT,RE,RET,T,TT,TG>,
RT extends TypedEdge.Type<S,ST,SG,R,RT,RG,I,RV,RVT,RE,RET,T,TT,TG>,
R extends TypedEdge<S,ST,SG,R,RT,RG,I,RV,RE,T,TT,TG>,
RT extends TypedEdge.Type<S,ST,SG,R,RT,RG,I,RV,RE,T,TT,TG>,
// property
P extends Property<R,RT,P,V,RG,I,RV,RVT,RE,RET>,
P extends Property<R,RT,P,V,RG,I,RV,RE>,
V,
RG extends TypedGraph<RG,I,RV,RVT,RE,RET>,
I extends UntypedGraph<RV,RVT,RE,RET>, RV,RVT, RE,RET,
RG extends TypedGraph<RG,I,RV,RE>,
I extends UntypedGraph<RV,RE>, RV,RE,
// tgt
T extends TypedVertex<T,TT,TG,I,RV,RVT,RE,RET>,
TT extends TypedVertex.Type<T,TT,TG,I,RV,RVT,RE,RET>,
TG extends TypedGraph<TG,I,RV,RVT,RE,RET>
T extends TypedVertex<T,TT,TG,I,RV,RE>,
TT extends TypedVertex.Type<T,TT,TG,I,RV,RE>,
TG extends TypedGraph<TG,I,RV,RE>
>
extends
TypedEdgeIndex<S,ST,SG, R,RT, P,V, RG,I,RV,RVT,RE,RET, T,TT,TG>,
TypedElementIndex.Unique<R,RT, P,V, RG,I,RV,RVT,RE,RET>
TypedEdgeIndex<S,ST,SG, R,RT, P,V, RG,I,RV,RE, T,TT,TG>,
TypedElementIndex.Unique<R,RT, P,V, RG,I,RV,RE>
{

/* get a node by providing a value of the indexed property. */
Expand All @@ -56,25 +56,25 @@ interface Unique <

interface List <
// src
S extends TypedVertex<S,ST,SG,I,RV,RVT,RE,RET>,
ST extends TypedVertex.Type<S,ST,SG,I,RV,RVT,RE,RET>,
SG extends TypedGraph<SG,I,RV,RVT,RE,RET>,
S extends TypedVertex<S,ST,SG,I,RV,RE>,
ST extends TypedVertex.Type<S,ST,SG,I,RV,RE>,
SG extends TypedGraph<SG,I,RV,RE>,
// rel
R extends TypedEdge<S,ST,SG,R,RT,RG,I,RV,RVT,RE,RET,T,TT,TG>,
RT extends TypedEdge.Type<S,ST,SG,R,RT,RG,I,RV,RVT,RE,RET,T,TT,TG>,
R extends TypedEdge<S,ST,SG,R,RT,RG,I,RV,RE,T,TT,TG>,
RT extends TypedEdge.Type<S,ST,SG,R,RT,RG,I,RV,RE,T,TT,TG>,
// property
P extends Property<R,RT,P,V,RG,I,RV,RVT,RE,RET>,
P extends Property<R,RT,P,V,RG,I,RV,RE>,
V,
RG extends TypedGraph<RG,I,RV,RVT,RE,RET>,
I extends UntypedGraph<RV,RVT,RE,RET>, RV,RVT, RE,RET,
RG extends TypedGraph<RG,I,RV,RE>,
I extends UntypedGraph<RV,RE>, RV,RE,
// tgt
T extends TypedVertex<T,TT,TG,I,RV,RVT,RE,RET>,
TT extends TypedVertex.Type<T,TT,TG,I,RV,RVT,RE,RET>,
TG extends TypedGraph<TG,I,RV,RVT,RE,RET>
T extends TypedVertex<T,TT,TG,I,RV,RE>,
TT extends TypedVertex.Type<T,TT,TG,I,RV,RE>,
TG extends TypedGraph<TG,I,RV,RE>
>
extends
TypedEdgeIndex<S,ST,SG, R,RT,P,V, RG,I,RV,RVT,RE,RET, T,TT,TG>,
TypedElementIndex.List<R,RT, P,V, RG,I,RV,RVT,RE,RET>
TypedEdgeIndex<S,ST,SG, R,RT,P,V, RG,I,RV,RE, T,TT,TG>,
TypedElementIndex.List<R,RT, P,V, RG,I,RV,RE>
{

/* get a list of nodes by providing a value of the indexed property. */
Expand Down
22 changes: 10 additions & 12 deletions src/main/java/com/bio4j/angulillos/TypedElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
`E` refers to the element itself, and `ET` its type. You cannot define one without defining the other.
*/
interface TypedElement <
E extends TypedElement<E,ET,G,I,RV,RVT,RE,RET>,
ET extends TypedElement.Type<E,ET,G,I,RV,RVT,RE,RET>,
G extends TypedGraph<G,I,RV,RVT,RE,RET>,
I extends UntypedGraph<RV,RVT,RE,RET>, RV,RVT, RE,RET
E extends TypedElement<E,ET,G,I,RV,RE>,
ET extends TypedElement.Type<E,ET,G,I,RV,RE>,
G extends TypedGraph<G,I,RV,RE>,
I extends UntypedGraph<RV,RE>, RV,RE
>
{

Expand All @@ -35,14 +35,14 @@ interface TypedElement <

/* The `get` method lets you get the value of a `property` which this element has. For that, you pass as an argument the [property](Property.java.md). Note that the type bounds only allow properties of this element. */
<
P extends Property<E,ET,P,V,G,I,RV,RVT,RE,RET>,
P extends Property<E,ET,P,V,G,I,RV,RE>,
V
>
V get(P property);

/* `set` sets the value of a `property` for this element. Again, you can only set properties that this element has, using values of the corresponding property value type. */
<
P extends Property<E,ET,P,V,G,I,RV,RVT,RE,RET>,
P extends Property<E,ET,P,V,G,I,RV,RE>,
V
>
E set(P property, V value);
Expand All @@ -53,13 +53,11 @@ interface TypedElement <
Element types are also used as factories for constructing instances of the corresponding elements.
*/
interface Type <
E extends TypedElement<E,ET,G,I,RV,RVT,RE,RET>,
ET extends TypedElement.Type<E,ET,G,I,RV,RVT,RE,RET>,
G extends TypedGraph<G,I,RV,RVT,RE,RET>,
I extends UntypedGraph<RV,RVT,RE,RET>, RV,RVT, RE,RET
E extends TypedElement<E,ET,G,I,RV,RE>,
ET extends TypedElement.Type<E,ET,G,I,RV,RE>,
G extends TypedGraph<G,I,RV,RE>,
I extends UntypedGraph<RV,RE>, RV,RE
> {
Object raw();

default String name() { return getClass().getCanonicalName(); }

G graph();
Expand Down
34 changes: 17 additions & 17 deletions src/main/java/com/bio4j/angulillos/TypedElementIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

interface TypedElementIndex <
// element
E extends TypedElement<E,ET,G,I,RV,RVT,RE,RET>,
ET extends TypedElement.Type<E,ET,G,I,RV,RVT,RE,RET>,
E extends TypedElement<E,ET,G,I,RV,RE>,
ET extends TypedElement.Type<E,ET,G,I,RV,RE>,
// property
P extends Property<E,ET,P,V,G,I,RV,RVT,RE,RET>, V,
P extends Property<E,ET,P,V,G,I,RV,RE>, V,
// graph
G extends TypedGraph<G,I,RV,RVT,RE,RET>,
I extends UntypedGraph<RV,RVT,RE,RET>, RV,RVT, RE,RET
G extends TypedGraph<G,I,RV,RE>,
I extends UntypedGraph<RV,RE>, RV,RE
>
{

Expand All @@ -38,15 +38,15 @@ interface TypedElementIndex <
/* This interface declares that this index is over a property that uniquely classifies a element type for exact match queries */
interface Unique <
// element
E extends TypedElement<E,ET,G,I,RV,RVT,RE,RET>,
ET extends TypedElement.Type<E,ET,G,I,RV,RVT,RE,RET>,
E extends TypedElement<E,ET,G,I,RV,RE>,
ET extends TypedElement.Type<E,ET,G,I,RV,RE>,
// property
P extends Property<E,ET,P,V,G,I,RV,RVT,RE,RET>, V,
P extends Property<E,ET,P,V,G,I,RV,RE>, V,
// graph
G extends TypedGraph<G,I,RV,RVT,RE,RET>,
I extends UntypedGraph<RV,RVT,RE,RET>, RV,RVT, RE,RET
G extends TypedGraph<G,I,RV,RE>,
I extends UntypedGraph<RV,RE>, RV,RE
>
extends TypedElementIndex<E,ET, P,V, G, I,RV,RVT,RE,RET>
extends TypedElementIndex<E,ET, P,V, G, I,RV,RE>
{

/* Get an element by providing a value of the indexed property */
Expand All @@ -59,15 +59,15 @@ default Optional<E> getElement(V byValue) {
/* This interface declares that this index is over a property that classifies lists of elements for exact match queries */
interface List <
// element
E extends TypedElement<E,ET,G,I,RV,RVT,RE,RET>,
ET extends TypedElement.Type<E,ET,G,I,RV,RVT,RE,RET>,
E extends TypedElement<E,ET,G,I,RV,RE>,
ET extends TypedElement.Type<E,ET,G,I,RV,RE>,
// property
P extends Property<E,ET,P,V,G,I,RV,RVT,RE,RET>, V,
P extends Property<E,ET,P,V,G,I,RV,RE>, V,
// graph
G extends TypedGraph<G,I,RV,RVT,RE,RET>,
I extends UntypedGraph<RV,RVT,RE,RET>, RV,RVT, RE,RET
G extends TypedGraph<G,I,RV,RE>,
I extends UntypedGraph<RV,RE>, RV,RE
>
extends TypedElementIndex<E,ET, P,V, G, I,RV,RVT,RE,RET>
extends TypedElementIndex<E,ET, P,V, G, I,RV,RE>
{

/* Get a list of elements by providing a value of the property */
Expand Down
Loading