Revision: 11798
http://sourceforge.net/p/foray/code/11798
Author: victormote
Date: 2021-01-16 00:41:43 +0000 (Sat, 16 Jan 2021)
Log Message:
-----------
Conform to aXSL changes removing isMutable() from Plus sequence interfaces, and adding some basic mutating methods to the Mutable sequence interfaces.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceChars.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceSubset.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongArrayBuilder.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArray.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArray.java 2021-01-15 22:42:32 UTC (rev 11797)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArray.java 2021-01-16 00:41:43 UTC (rev 11798)
@@ -232,11 +232,6 @@
}
@Override
- public boolean isMutable() {
- return false;
- }
-
- @Override
public ByteSequenceMutable asMutable() {
return null;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArrayBuilder.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArrayBuilder.java 2021-01-15 22:42:32 UTC (rev 11797)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArrayBuilder.java 2021-01-16 00:41:43 UTC (rev 11798)
@@ -361,11 +361,6 @@
return null;
}
- @Override
- public boolean isMutable() {
- return true;
- }
-
/**
* Resets the length of this sequence to a specified length.
* The <em>capacity</em> of the sequence remains unchanged unless it needs to increase to accommodate a bigger size.
@@ -410,4 +405,16 @@
return this;
}
+ @Override
+ public void setByteAt(final int index, final byte newByte) {
+ this.backingArray[index] = newByte;
+ }
+
+ @Override
+ public void swap(final int index1, final int index2) {
+ final byte temp = this.backingArray[index1];
+ this.backingArray[index1] = this.backingArray[index2];
+ this.backingArray[index2] = temp;
+ }
+
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceChars.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceChars.java 2021-01-15 22:42:32 UTC (rev 11797)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceChars.java 2021-01-16 00:41:43 UTC (rev 11798)
@@ -121,11 +121,6 @@
}
@Override
- public boolean isMutable() {
- return ! (this.sequence instanceof String);
- }
-
- @Override
public ByteSequenceMutable asMutable() {
return null;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceSubset.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceSubset.java 2021-01-15 22:42:32 UTC (rev 11797)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceSubset.java 2021-01-16 00:41:43 UTC (rev 11798)
@@ -78,11 +78,6 @@
}
@Override
- public boolean isMutable() {
- return this.wrappedSequence.isMutable();
- }
-
- @Override
public byte[] toArray() {
final byte[] array = new byte[this.length];
for (int index = 0; index < array.length; index ++) {
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharArrayBuilder.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharArrayBuilder.java 2021-01-15 22:42:32 UTC (rev 11797)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharArrayBuilder.java 2021-01-16 00:41:43 UTC (rev 11798)
@@ -205,11 +205,6 @@
}
}
- @Override
- public boolean isMutable() {
- return true;
- }
-
/**
* Resets the length of this sequence to a specified length.
* The <em>capacity</em> of the sequence remains unchanged unless it needs to increase to accommodate a bigger size.
@@ -306,4 +301,11 @@
return new CharSequenceIterator(this, true);
}
+ @Override
+ public void swap(final int index1, final int index2) {
+ final char temp = this.backingArray[index1];
+ this.backingArray[index1] = this.backingArray[index2];
+ this.backingArray[index2] = temp;
+ }
+
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntArrayBuilder.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntArrayBuilder.java 2021-01-15 22:42:32 UTC (rev 11797)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntArrayBuilder.java 2021-01-16 00:41:43 UTC (rev 11798)
@@ -169,6 +169,23 @@
this.array = Arrays.copyOf(this.array, newCapacity);
}
+ @Override
+ public void setIntAt(final int index, final int newInt) {
+ this.array[index] = newInt;
+ }
+
+ @Override
+ public void sort() {
+ Arrays.sort(this.array);
+ }
+
+ @Override
+ public void swap(final int index1, final int index2) {
+ final int temp = this.array[index1];
+ this.array[index1] = this.array[index2];
+ this.array[index2] = temp;
+ }
+
/**
* Append an int to this structure.
* @param intToAppend The int to append.
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongArrayBuilder.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongArrayBuilder.java 2021-01-15 22:42:32 UTC (rev 11797)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongArrayBuilder.java 2021-01-16 00:41:43 UTC (rev 11798)
@@ -306,4 +306,21 @@
return new LongSequenceIterator(this, true);
}
+ @Override
+ public void setLongAt(final int index, final long newLong) {
+ this.array[index] = newLong;
+ }
+
+ @Override
+ public void sort() {
+ Arrays.sort(this.array);
+ }
+
+ @Override
+ public void swap(final int index1, final int index2) {
+ final long temp = this.array[index1];
+ this.array[index1] = this.array[index2];
+ this.array[index2] = temp;
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|