mirror of
https://github.com/apache/commons-collections.git
synced 2025-02-27 13:36:33 +00:00
No _ in private variable name
This commit is contained in:
parent
700fc2623b
commit
8d48789ea5
@ -185,37 +185,37 @@ public abstract class AbstractSortedSetTest<E> extends AbstractSetTest<E> {
|
|||||||
|
|
||||||
public class TestSortedSetSubSet extends AbstractSortedSetTest<E> {
|
public class TestSortedSetSubSet extends AbstractSortedSetTest<E> {
|
||||||
|
|
||||||
private final int m_Type;
|
private final int type;
|
||||||
private int m_LowBound;
|
private int lowBound;
|
||||||
private int m_HighBound;
|
private int highBound;
|
||||||
private final E[] m_FullElements;
|
private final E[] fullElements;
|
||||||
private final E[] m_OtherElements;
|
private final E[] otherElements;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public TestSortedSetSubSet(final int bound, final boolean head) {
|
public TestSortedSetSubSet(final int bound, final boolean head) {
|
||||||
super("TestSortedSetSubSet");
|
super("TestSortedSetSubSet");
|
||||||
if (head) {
|
if (head) {
|
||||||
//System.out.println("HEADSET");
|
//System.out.println("HEADSET");
|
||||||
m_Type = TYPE_HEADSET;
|
this.type = TYPE_HEADSET;
|
||||||
m_HighBound = bound;
|
this.highBound = bound;
|
||||||
m_FullElements = (E[]) new Object[bound];
|
this.fullElements = (E[]) new Object[bound];
|
||||||
System.arraycopy(AbstractSortedSetTest.this.getFullElements(), 0, m_FullElements, 0, bound);
|
System.arraycopy(AbstractSortedSetTest.this.getFullElements(), 0, fullElements, 0, bound);
|
||||||
m_OtherElements = (E[]) new Object[bound - 1];
|
this.otherElements = (E[]) new Object[bound - 1];
|
||||||
System.arraycopy(//src src_pos dst dst_pos length
|
System.arraycopy(//src src_pos dst dst_pos length
|
||||||
AbstractSortedSetTest.this.getOtherElements(), 0, m_OtherElements, 0, bound - 1);
|
AbstractSortedSetTest.this.getOtherElements(), 0, otherElements, 0, bound - 1);
|
||||||
//System.out.println(new TreeSet(Arrays.asList(m_FullElements)));
|
//System.out.println(new TreeSet(Arrays.asList(m_FullElements)));
|
||||||
//System.out.println(new TreeSet(Arrays.asList(m_OtherElements)));
|
//System.out.println(new TreeSet(Arrays.asList(m_OtherElements)));
|
||||||
} else {
|
} else {
|
||||||
//System.out.println("TAILSET");
|
//System.out.println("TAILSET");
|
||||||
m_Type = TYPE_TAILSET;
|
this.type = TYPE_TAILSET;
|
||||||
m_LowBound = bound;
|
this.lowBound = bound;
|
||||||
final Object[] allElements = AbstractSortedSetTest.this.getFullElements();
|
final Object[] allElements = AbstractSortedSetTest.this.getFullElements();
|
||||||
//System.out.println("bound = "+bound +"::length="+allElements.length);
|
//System.out.println("bound = "+bound +"::length="+allElements.length);
|
||||||
m_FullElements = (E[]) new Object[allElements.length - bound];
|
this.fullElements = (E[]) new Object[allElements.length - bound];
|
||||||
System.arraycopy(allElements, bound, m_FullElements, 0, allElements.length - bound);
|
System.arraycopy(allElements, bound, fullElements, 0, allElements.length - bound);
|
||||||
m_OtherElements = (E[]) new Object[allElements.length - bound - 1];
|
this.otherElements = (E[]) new Object[allElements.length - bound - 1];
|
||||||
System.arraycopy(//src src_pos dst dst_pos length
|
System.arraycopy(//src src_pos dst dst_pos length
|
||||||
AbstractSortedSetTest.this.getOtherElements(), bound, m_OtherElements, 0, allElements.length - bound - 1);
|
AbstractSortedSetTest.this.getOtherElements(), bound, otherElements, 0, allElements.length - bound - 1);
|
||||||
//System.out.println(new TreeSet(Arrays.asList(m_FullElements)));
|
//System.out.println(new TreeSet(Arrays.asList(m_FullElements)));
|
||||||
//System.out.println(new TreeSet(Arrays.asList(m_OtherElements)));
|
//System.out.println(new TreeSet(Arrays.asList(m_OtherElements)));
|
||||||
//resetFull();
|
//resetFull();
|
||||||
@ -230,16 +230,16 @@ public abstract class AbstractSortedSetTest<E> extends AbstractSetTest<E> {
|
|||||||
public TestSortedSetSubSet(final int loBound, final int hiBound) {
|
public TestSortedSetSubSet(final int loBound, final int hiBound) {
|
||||||
super("TestSortedSetSubSet");
|
super("TestSortedSetSubSet");
|
||||||
//System.out.println("SUBSET");
|
//System.out.println("SUBSET");
|
||||||
m_Type = TYPE_SUBSET;
|
this.type = TYPE_SUBSET;
|
||||||
m_LowBound = loBound;
|
this.lowBound = loBound;
|
||||||
m_HighBound = hiBound;
|
this.highBound = hiBound;
|
||||||
final int length = hiBound - loBound;
|
final int length = hiBound - loBound;
|
||||||
//System.out.println("Low=" + loBound + "::High=" + hiBound + "::Length=" + length);
|
//System.out.println("Low=" + loBound + "::High=" + hiBound + "::Length=" + length);
|
||||||
m_FullElements = (E[]) new Object[length];
|
this.fullElements = (E[]) new Object[length];
|
||||||
System.arraycopy(AbstractSortedSetTest.this.getFullElements(), loBound, m_FullElements, 0, length);
|
System.arraycopy(AbstractSortedSetTest.this.getFullElements(), loBound, fullElements, 0, length);
|
||||||
m_OtherElements = (E[]) new Object[length - 1];
|
this.otherElements = (E[]) new Object[length - 1];
|
||||||
System.arraycopy(//src src_pos dst dst_pos length
|
System.arraycopy(//src src_pos dst dst_pos length
|
||||||
AbstractSortedSetTest.this.getOtherElements(), loBound, m_OtherElements, 0, length - 1);
|
AbstractSortedSetTest.this.getOtherElements(), loBound, otherElements, 0, length - 1);
|
||||||
|
|
||||||
//System.out.println(new TreeSet(Arrays.asList(m_FullElements)));
|
//System.out.println(new TreeSet(Arrays.asList(m_FullElements)));
|
||||||
//System.out.println(new TreeSet(Arrays.asList(m_OtherElements)));
|
//System.out.println(new TreeSet(Arrays.asList(m_OtherElements)));
|
||||||
@ -265,22 +265,22 @@ public abstract class AbstractSortedSetTest<E> extends AbstractSetTest<E> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public E[] getFullElements() {
|
public E[] getFullElements() {
|
||||||
return m_FullElements;
|
return fullElements;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public E[] getOtherElements() {
|
public E[] getOtherElements() {
|
||||||
return m_OtherElements;
|
return otherElements;
|
||||||
}
|
}
|
||||||
|
|
||||||
private SortedSet<E> getSubSet(final SortedSet<E> set) {
|
private SortedSet<E> getSubSet(final SortedSet<E> set) {
|
||||||
final E[] elements = AbstractSortedSetTest.this.getFullElements();
|
final E[] elements = AbstractSortedSetTest.this.getFullElements();
|
||||||
switch (m_Type) {
|
switch (type) {
|
||||||
case TYPE_SUBSET :
|
case TYPE_SUBSET :
|
||||||
return set.subSet(elements[m_LowBound], elements[m_HighBound]);
|
return set.subSet(elements[lowBound], elements[highBound]);
|
||||||
case TYPE_HEADSET :
|
case TYPE_HEADSET :
|
||||||
return set.headSet(elements[m_HighBound]);
|
return set.headSet(elements[highBound]);
|
||||||
case TYPE_TAILSET :
|
case TYPE_TAILSET :
|
||||||
return set.tailSet(elements[m_LowBound]);
|
return set.tailSet(elements[lowBound]);
|
||||||
default :
|
default :
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user