[Mulgara-svn] r1037 - trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd

pag at mulgara.org pag at mulgara.org
Wed Jul 2 21:26:19 UTC 2008


Author: pag
Date: 2008-07-02 14:26:18 -0700 (Wed, 02 Jul 2008)
New Revision: 1037

Modified:
   trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/IntervalConstraint.java
Log:
Added a factory method for copying with a modification

Modified: trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/IntervalConstraint.java
===================================================================
--- trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/IntervalConstraint.java	2008-07-02 21:25:25 UTC (rev 1036)
+++ trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/IntervalConstraint.java	2008-07-02 21:26:18 UTC (rev 1037)
@@ -133,6 +133,16 @@
   }
 
   /**
+   * Used to create a copy of this constraint with a new variable and model.
+   * @param variable The variable to use in the new constraint.
+   * @param model The model to use in the new constraint.
+   * @return A new constraint with the same properties as this one, but with a different variable and model.
+   */
+  public IntervalConstraint mutateTo(Variable variable, URIReference model) {
+    return new IntervalConstraint(variable, lowerBound, upperBound, model);
+  }
+
+  /**
    * @param intervalConstraint  an instance constraining the same variable as
    *   this one, never <code>null</code>
    * @throws IllegalArgumentException if the <var>intervalConstraint</var> does




More information about the Mulgara-svn mailing list