forked from apache/flink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-4646] [gelly] Add BipartiateGraph
This closes apache#2564
- Loading branch information
Showing
9 changed files
with
807 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
...k-libraries/flink-gelly/src/main/java/org/apache/flink/graph/bipartite/BipartiteEdge.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.flink.graph.bipartite; | ||
|
||
import org.apache.flink.api.java.tuple.Tuple3; | ||
import org.apache.flink.graph.Edge; | ||
|
||
/** | ||
* A BipartiteEdge represents a link between top and bottom vertices | ||
* in a {@link BipartiteGraph}. It is generalized form of {@link Edge} | ||
* where the source and target vertex IDs can be of different types. | ||
* | ||
* @param <KT> the key type of the top vertices | ||
* @param <KB> the key type of the bottom vertices | ||
* @param <EV> the edge value type | ||
*/ | ||
public class BipartiteEdge<KT, KB, EV> extends Tuple3<KT, KB, EV> { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
public BipartiteEdge() {} | ||
|
||
public BipartiteEdge(KT topId, KB bottomId, EV value) { | ||
this.f0 = topId; | ||
this.f1 = bottomId; | ||
this.f2 = value; | ||
} | ||
|
||
public KT getTopId() { | ||
return this.f0; | ||
} | ||
|
||
public void setTopId(KT topId) { | ||
this.f0 = topId; | ||
} | ||
|
||
public KB getBottomId() { | ||
return this.f1; | ||
} | ||
|
||
public void setBottomId(KB bottomId) { | ||
this.f1 = bottomId; | ||
} | ||
|
||
public EV getValue() { | ||
return this.f2; | ||
} | ||
|
||
public void setValue(EV value) { | ||
this.f2 = value; | ||
} | ||
} |
Oops, something went wrong.