Author: simonetripodi
Date: Wed Mar  7 23:31:43 2012
New Revision: 1298212

URL: http://svn.apache.org/viewvc?rev=1298212&view=rev
Log:
added builder to plug the mapper that gives weights for edges

Added:
    
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/DefaultFlowWeightedEdgesBuilder.java
   (with props)
    
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/FlowWeightedEdgesBuilder.java
   (with props)

Added: 
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/DefaultFlowWeightedEdgesBuilder.java
URL: 
http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/DefaultFlowWeightedEdgesBuilder.java?rev=1298212&view=auto
==============================================================================
--- 
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/DefaultFlowWeightedEdgesBuilder.java
 (added)
+++ 
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/DefaultFlowWeightedEdgesBuilder.java
 Wed Mar  7 23:31:43 2012
@@ -0,0 +1,44 @@
+package org.apache.commons.graph.flow;
+
+/*
+ * 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.
+ */
+
+import static org.apache.commons.graph.utils.Assertions.checkNotNull;
+
+import org.apache.commons.graph.DirectedGraph;
+import org.apache.commons.graph.Mapper;
+
+public final class DefaultFlowWeightedEdgesBuilder<V, WE, G extends 
DirectedGraph<V, WE>>
+    implements FlowWeightedEdgesBuilder<V, WE, G>
+{
+
+    private final G graph;
+
+    public DefaultFlowWeightedEdgesBuilder( G graph )
+    {
+        this.graph = graph;
+    }
+
+    public <W> FromHeadBuilder<V, WE, W, G> whereEdgesHaveWeights( Mapper<WE, 
W> weightedEdges )
+    {
+        weightedEdges = checkNotNull( weightedEdges, "Function to calculate 
edges weight can not be null." );
+        return null;
+    }
+
+}

Propchange: 
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/DefaultFlowWeightedEdgesBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/DefaultFlowWeightedEdgesBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: 
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/DefaultFlowWeightedEdgesBuilder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/FlowWeightedEdgesBuilder.java
URL: 
http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/FlowWeightedEdgesBuilder.java?rev=1298212&view=auto
==============================================================================
--- 
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/FlowWeightedEdgesBuilder.java
 (added)
+++ 
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/FlowWeightedEdgesBuilder.java
 Wed Mar  7 23:31:43 2012
@@ -0,0 +1,30 @@
+package org.apache.commons.graph.flow;
+
+/*
+ * 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.
+ */
+
+import org.apache.commons.graph.DirectedGraph;
+import org.apache.commons.graph.Mapper;
+
+public interface FlowWeightedEdgesBuilder<V, WE, G extends DirectedGraph<V, 
WE>>
+{
+
+    <W> FromHeadBuilder<V, WE, W, G> whereEdgesHaveWeights( Mapper<WE, W> 
weightedEdges );
+
+}

Propchange: 
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/FlowWeightedEdgesBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/FlowWeightedEdgesBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: 
commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/flow/FlowWeightedEdgesBuilder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain


Reply via email to