Author: simonetripodi
Date: Sat Jun 11 13:10:14 2011
New Revision: 1134620
URL: http://svn.apache.org/viewvc?rev=1134620&view=rev
Log:
'double' as a weight is too restrictive, using Java5 Generics is possible to
allow users define their own type number as a weight
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/WeightedEdge.java
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/WeightedEdge.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/WeightedEdge.java?rev=1134620&r1=1134619&r2=1134620&view=diff
==============================================================================
---
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/WeightedEdge.java
(original)
+++
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/WeightedEdge.java
Sat Jun 11 13:10:14 2011
@@ -1,7 +1,7 @@
package org.apache.commons.graph;
/*
- * Copyright 2001,2004 The Apache Software Foundation.
+ * Copyright 2001-2011 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,11 +19,13 @@ package org.apache.commons.graph;
/**
* Description of the Interface
*/
-public interface WeightedEdge
+public interface WeightedEdge<W extends Number>
extends Edge
{
+
/**
* Gets the weight attribute of the WeightedEdge object
*/
- public double getWeight();
+ W getWeight();
+
}