Update of /cvsroot/metamorphosis/krysalis-version/src/java/org/krysalis/version/internal/data/util
In directory sc8-pr-cvs1:/tmp/cvs-serv9981/src/java/org/krysalis/version/internal/data/util
Modified Files:
VersionDataComparison.java
Log Message:
Try removing directories I thought I'd already removed.
Constraints from text file.
Index: VersionDataComparison.java
===================================================================
RCS file: /cvsroot/metamorphosis/krysalis-version/src/java/org/krysalis/version/internal/data/util/VersionDataComparison.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** VersionDataComparison.java 3 Feb 2003 07:28:33 -0000 1.3
--- VersionDataComparison.java 16 Feb 2003 00:08:11 -0000 1.4
***************
*** 59,62 ****
--- 59,63 ----
import org.krysalis.version.exception.VersionError;
+ import org.krysalis.version.exception.VersionException;
import org.krysalis.version.internal.data.VersionData;
***************
*** 107,111 ****
public static VersionDataComparison getLessThanOrEqual(VersionData comparisonData) {
! return new VersionDataComparison(TYPE_LESS_THAN_OR_EQUAL, comparisonData);
}
--- 108,114 ----
public static VersionDataComparison getLessThanOrEqual(VersionData comparisonData) {
! return new VersionDataComparison(
! TYPE_LESS_THAN_OR_EQUAL,
! comparisonData);
}
***************
*** 125,128 ****
--- 128,137 ----
}
+ public VersionDataComparison(String type, VersionData comparisonData)
+ throws VersionException {
+ m_type = getTypeForString(type);
+ m_comparisonData = comparisonData;
+ }
+
public VersionDataComparison(VersionData comparisonData) {
m_type = TYPE_EQUAL;
***************
*** 272,275 ****
--- 281,305 ----
return representation;
+ }
+
+ private int getTypeForString(String type) throws VersionException {
+ int typeVal = TYPE_UNSET;
+
+ if ("<".equals(type))
+ typeVal = TYPE_LESS_THAN;
+ else if ("<=".equals(type))
+ typeVal = TYPE_LESS_THAN_OR_EQUAL;
+ else if ("=".equals(type))
+ typeVal = TYPE_EQUAL;
+ else if ("!=".equals(type))
+ typeVal = TYPE_NOT_EQUAL;
+ else if (">".equals(type))
+ typeVal = TYPE_GREATER_THAN;
+ else if (">=".equals(type))
+ typeVal = TYPE_GREATER_THAN_OR_EQUAL;
+ else
+ throw new VersionException("Unknown Operation : [" + type + "]");
+
+ return typeVal;
}
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.