You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ps...@apache.org on 2004/03/17 12:47:15 UTC
cvs commit: jakarta-commons-sandbox/id/src/java/org/apache/commons/id/serial AlphanumericGenerator.java LongGenerator.java NumericGenerator.java
psteitz 2004/03/17 03:47:15
Modified: id/src/java/org/apache/commons/id/serial
AlphanumericGenerator.java LongGenerator.java
NumericGenerator.java
Log:
Changed "wrap" property to "wrapping"
Minor code cleanup
Contributed by Tim Reilly
PR #27725
Revision Changes Path
1.4 +10 -10 jakarta-commons-sandbox/id/src/java/org/apache/commons/id/serial/AlphanumericGenerator.java
Index: AlphanumericGenerator.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/id/src/java/org/apache/commons/id/serial/AlphanumericGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AlphanumericGenerator.java 29 Feb 2004 16:06:33 -0000 1.3
+++ AlphanumericGenerator.java 17 Mar 2004 11:47:15 -0000 1.4
@@ -1,12 +1,12 @@
/*
* Copyright 2003-2004 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.
* 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.
@@ -31,7 +31,7 @@
* base 36 digits. If <code>wrap</code> is false and the the maximum representable
* value is exceeded, an IllegalStateException is thrown</p>
*
- * @author Commons-Uid team
+ * @author Commons-Id team
* @version $Id$
*/
public class AlphanumericGenerator extends AbstractStringIdentifierGenerator {
@@ -39,7 +39,7 @@
/**
* Should the counter wrap.
*/
- private boolean wrap = true;
+ private boolean wrapping = true;
/**
* The counter.
@@ -65,7 +65,7 @@
*/
public AlphanumericGenerator(boolean wrap, int size) {
super();
- this.wrap = wrap;
+ this.wrapping = wrap;
if (size < 1) {
throw new IllegalArgumentException("The size must be at least one");
}
@@ -102,7 +102,7 @@
*
*/
public boolean isWrap() {
- return wrap;
+ return wrapping;
}
/**
@@ -112,7 +112,7 @@
*
*/
public void setWrap(boolean wrap) {
- this.wrap = wrap;
+ this.wrapping = wrap;
}
/**
@@ -134,7 +134,7 @@
switch (count[i]) {
case Z_CHAR: // z
count[i] = '0';
- if (i == 0 && !wrap) {
+ if (i == 0 && !wrapping) {
throw new IllegalStateException
("The maximum number of identifiers has been reached");
}
1.4 +10 -10 jakarta-commons-sandbox/id/src/java/org/apache/commons/id/serial/LongGenerator.java
Index: LongGenerator.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/id/src/java/org/apache/commons/id/serial/LongGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LongGenerator.java 29 Feb 2004 16:06:33 -0000 1.3
+++ LongGenerator.java 17 Mar 2004 11:47:15 -0000 1.4
@@ -1,12 +1,12 @@
/*
* Copyright 2003-2004 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.
* 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.
@@ -27,13 +27,13 @@
* <code>Long.MAX_VALUE</code> reached; otherwise an <code>IllegalStateException</code>
* will be thrown.</p>
*
- * @author Commons-Uid team
+ * @author Commons-Id team
* @version $Id$
*/
public class LongGenerator extends AbstractLongIdentifierGenerator {
/** Should the counter wrap. */
- private boolean wrap;
+ private boolean wrapping;
/** The counter. */
private long count = 0;
/**
@@ -45,7 +45,7 @@
*/
public LongGenerator(boolean wrap, long initialValue) {
super();
- this.wrap = wrap;
+ this.wrapping = wrap;
this.count = initialValue;
}
@@ -74,7 +74,7 @@
*
*/
public boolean isWrap() {
- return wrap;
+ return wrapping;
}
/**
@@ -84,7 +84,7 @@
*
*/
public void setWrap(boolean wrap) {
- this.wrap = wrap;
+ this.wrapping = wrap;
}
/**
* <p>Gets the next identifier in the sequence.</p>
@@ -93,7 +93,7 @@
*/
public Long nextLongIdentifier() {
long value = 0;
- if (wrap) {
+ if (wrapping) {
synchronized (this) {
value = count++;
}
1.4 +10 -10 jakarta-commons-sandbox/id/src/java/org/apache/commons/id/serial/NumericGenerator.java
Index: NumericGenerator.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/id/src/java/org/apache/commons/id/serial/NumericGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- NumericGenerator.java 29 Feb 2004 16:06:33 -0000 1.3
+++ NumericGenerator.java 17 Mar 2004 11:47:15 -0000 1.4
@@ -1,12 +1,12 @@
/*
* Copyright 2003-2004 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.
* 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.
@@ -27,13 +27,13 @@
* <code>Long.MAX_VALUE</code> reached; otherwise an <code>IllegalStateException</code>
* will be thrown.</p>
*
- * @author Commons-Uid team
+ * @author Commons-Id team
* @version $Id$
*/
public class NumericGenerator extends AbstractStringIdentifierGenerator {
/** Should the counter wrap. */
- private boolean wrap;
+ private boolean wrapping;
/** The counter. */
private long count = 0;
@@ -46,7 +46,7 @@
*/
public NumericGenerator(boolean wrap, long initialValue) {
super();
- this.wrap = wrap;
+ this.wrapping = wrap;
this.count = initialValue;
}
@@ -77,7 +77,7 @@
*
*/
public boolean isWrap() {
- return wrap;
+ return wrapping;
}
/**
@@ -87,7 +87,7 @@
*
*/
public void setWrap(boolean wrap) {
- this.wrap = wrap;
+ this.wrapping = wrap;
}
/**
@@ -97,7 +97,7 @@
*/
public String nextStringIdentifier() {
long value = 0;
- if (wrap) {
+ if (wrapping) {
synchronized (this) {
value = count++;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org