formatting

This commit is contained in:
Stepan Koltsov
2012-06-08 21:36:49 +04:00
parent 321c781c90
commit acac0eddc7
48 changed files with 475 additions and 475 deletions
+3 -3
View File
@@ -60,7 +60,7 @@ public final class ByteRange implements Range<Byte>, ByteIterable {
}
public ByteIterator step(int step) {
if(step < 0)
if (step < 0)
return new MyIterator(getEnd(), -count, -step);
else
return new MyIterator(start, count, step);
@@ -89,7 +89,7 @@ public final class ByteRange implements Range<Byte>, ByteIterable {
public MyIterator(byte startValue, int count, int step) {
cur = startValue;
this.step = step;
if(count < 0) {
if (count < 0) {
reversed = true;
count = -count;
startValue += count;
@@ -108,7 +108,7 @@ public final class ByteRange implements Range<Byte>, ByteIterable {
@Override
public byte nextByte() {
count -= step;
if(reversed) {
if (reversed) {
cur -= step;
return (byte) (cur + step);
}
+3 -3
View File
@@ -64,7 +64,7 @@ public final class CharRange implements Range<Character>, CharIterable {
}
public CharIterator step(int step) {
if(step < 0)
if (step < 0)
return new MyIterator(getEnd(), -count, -step);
else
return new MyIterator(start, count, step);
@@ -89,7 +89,7 @@ public final class CharRange implements Range<Character>, CharIterable {
public MyIterator(char startValue, int count, int step) {
cur = startValue;
this.step = step;
if(count < 0) {
if (count < 0) {
reversed = true;
count = -count;
startValue += count;
@@ -108,7 +108,7 @@ public final class CharRange implements Range<Character>, CharIterable {
@Override
public char nextChar() {
count -= step;
if(reversed) {
if (reversed) {
cur -= step;
return (char) (cur + step);
}
+4 -4
View File
@@ -38,7 +38,7 @@ public final class DoubleRange implements Range<Double> {
}
public DoubleIterator step(double step) {
if(step < 0)
if (step < 0)
return new MyIterator(getEnd(), -size, -step);
else
return new MyIterator(start, size, step);
@@ -78,7 +78,7 @@ public final class DoubleRange implements Range<Double> {
public MyIterator(double startValue, double size, double step) {
cur = startValue;
this.step = step;
if(size < 0) {
if (size < 0) {
reversed = true;
end = startValue-size;
startValue -= size;
@@ -91,7 +91,7 @@ public final class DoubleRange implements Range<Double> {
@Override
public boolean getHasNext() {
if(reversed)
if (reversed)
return cur >= end;
else
return cur <= end;
@@ -99,7 +99,7 @@ public final class DoubleRange implements Range<Double> {
@Override
public double nextDouble() {
if(reversed) {
if (reversed) {
cur -= step;
return cur + step;
}
+4 -4
View File
@@ -38,7 +38,7 @@ public final class FloatRange implements Range<Float> {
}
public FloatIterator step(float step) {
if(step < 0)
if (step < 0)
return new MyIterator(getEnd(), -size, -step);
else
return new MyIterator(start, size, step);
@@ -78,7 +78,7 @@ public final class FloatRange implements Range<Float> {
public MyIterator(float startValue, float size, float step) {
cur = startValue;
this.step = step;
if(size < 0) {
if (size < 0) {
reversed = true;
end = startValue-size;
startValue -= size;
@@ -91,7 +91,7 @@ public final class FloatRange implements Range<Float> {
@Override
public boolean getHasNext() {
if(reversed)
if (reversed)
return cur >= end;
else
return cur <= end;
@@ -99,7 +99,7 @@ public final class FloatRange implements Range<Float> {
@Override
public float nextFloat() {
if(reversed) {
if (reversed) {
cur -= step;
return cur + step;
}
+3 -3
View File
@@ -40,7 +40,7 @@ public final class IntRange implements Range<Integer>, IntIterable {
}
public IntIterator step(int step) {
if(step < 0)
if (step < 0)
return new MyIterator(getEnd(), -count, -step);
else
return new MyIterator(start, count, step);
@@ -89,7 +89,7 @@ public final class IntRange implements Range<Integer>, IntIterable {
public MyIterator(int startValue, int count, int step) {
cur = startValue;
this.step = step;
if(count < 0) {
if (count < 0) {
reversed = true;
count = -count;
startValue += count;
@@ -108,7 +108,7 @@ public final class IntRange implements Range<Integer>, IntIterable {
@Override
public int nextInt() {
count -= step;
if(reversed) {
if (reversed) {
cur -= step;
return cur + step;
}
+3 -3
View File
@@ -31,7 +31,7 @@ public final class LongRange implements Range<Long>, LongIterable {
}
public LongIterator step(long step) {
if(step < 0)
if (step < 0)
return new MyIterator(getEnd(), -count, -step);
else
return new MyIterator(start, count, step);
@@ -89,7 +89,7 @@ public final class LongRange implements Range<Long>, LongIterable {
public MyIterator(long startValue, long count, long step) {
cur = startValue;
this.step = step;
if(count < 0) {
if (count < 0) {
reversed = true;
count = -count;
startValue += count;
@@ -108,7 +108,7 @@ public final class LongRange implements Range<Long>, LongIterable {
@Override
public long nextLong() {
count -= step;
if(reversed) {
if (reversed) {
cur -= step;
return (cur + step);
}
+3 -3
View File
@@ -31,7 +31,7 @@ public final class ShortRange implements Range<Short>, ShortIterable {
}
public ShortIterator step(int step) {
if(step < 0)
if (step < 0)
return new MyIterator(getEnd(), -count, -step);
else
return new MyIterator(start, count, step);
@@ -89,7 +89,7 @@ public final class ShortRange implements Range<Short>, ShortIterable {
public MyIterator(short startValue, int count, int step) {
cur = startValue;
this.step = step;
if(count < 0) {
if (count < 0) {
reversed = true;
count = -count;
startValue += count;
@@ -108,7 +108,7 @@ public final class ShortRange implements Range<Short>, ShortIterable {
@Override
public short nextShort() {
count -= step;
if(reversed) {
if (reversed) {
cur -= step;
return (short) (cur + step);
}
+7 -7
View File
@@ -64,7 +64,7 @@ public class Intrinsics {
ArrayList<StackTraceElement> list = new ArrayList<StackTraceElement>();
boolean skip = true;
for(StackTraceElement ste : stackTrace) {
if(!skip) {
if (!skip) {
list.add(ste);
}
else {
@@ -87,25 +87,25 @@ public class Intrinsics {
public static class SpreadBuilder extends ArrayList {
public void addSpread(Object array) {
if(array != null) {
if(array instanceof Object[]) {
if (array != null) {
if (array instanceof Object[]) {
Object[] arr = (Object[]) array;
if(arr.length > 0) {
if (arr.length > 0) {
ensureCapacity(size() + arr.length);
for (int i = 0; i < arr.length; i++) {
add(arr[i]);
}
}
}
else if(array instanceof Collection) {
else if (array instanceof Collection) {
addAll((Collection) array);
}
else if(array instanceof Iterable) {
else if (array instanceof Iterable) {
for(Iterator iterator = ((Iterable) array).iterator(); iterator.hasNext(); ) {
add(iterator.next());
}
}
else if(array instanceof Iterator) {
else if (array instanceof Iterator) {
for(Iterator iterator = ((Iterator) array); iterator.hasNext(); ) {
add(iterator.next());
}
+50 -50
View File
@@ -29,7 +29,7 @@ public class Ranges {
}
public static ByteRange upTo(byte from, byte to) {
if(from > to) {
if (from > to) {
return ByteRange.empty;
}
else {
@@ -38,7 +38,7 @@ public class Ranges {
}
public static ByteRange downTo(byte from, byte to) {
if(from > to) {
if (from > to) {
return new ByteRange(from, to-from-1);
}
else {
@@ -47,7 +47,7 @@ public class Ranges {
}
public static ShortRange upTo(byte from, short to) {
if(from > to) {
if (from > to) {
return ShortRange.empty;
}
else {
@@ -56,7 +56,7 @@ public class Ranges {
}
public static ShortRange downTo(byte from, short to) {
if(from > to) {
if (from > to) {
return new ShortRange(from, to-from-1);
}
else {
@@ -65,7 +65,7 @@ public class Ranges {
}
public static IntRange upTo(byte from, int to) {
if(from > to) {
if (from > to) {
return IntRange.empty;
}
else {
@@ -74,7 +74,7 @@ public class Ranges {
}
public static IntRange downTo(byte from, int to) {
if(from > to) {
if (from > to) {
return new IntRange(from, to-from-1);
}
else {
@@ -83,7 +83,7 @@ public class Ranges {
}
public static LongRange upTo(byte from, long to) {
if(from > to) {
if (from > to) {
return LongRange.empty;
}
else {
@@ -92,7 +92,7 @@ public class Ranges {
}
public static LongRange downTo(byte from, long to) {
if(from > to) {
if (from > to) {
return new LongRange(from, to-from-1);
}
else {
@@ -117,7 +117,7 @@ public class Ranges {
}
public static CharRange upTo(byte from, char to) {
if(from > to) {
if (from > to) {
return CharRange.empty;
}
else {
@@ -126,7 +126,7 @@ public class Ranges {
}
public static CharRange downTo(byte from, char to) {
if(from > to) {
if (from > to) {
return new CharRange((char) from, to-from-1);
}
else {
@@ -135,7 +135,7 @@ public class Ranges {
}
public static ShortRange upTo(short from, byte to) {
if(from > to) {
if (from > to) {
return ShortRange.empty;
}
else {
@@ -144,7 +144,7 @@ public class Ranges {
}
public static ShortRange downTo(short from, byte to) {
if(from > to) {
if (from > to) {
return new ShortRange(from, to-from-1);
}
else {
@@ -153,7 +153,7 @@ public class Ranges {
}
public static ShortRange upTo(short from, short to) {
if(from > to) {
if (from > to) {
return ShortRange.empty;
}
else {
@@ -162,7 +162,7 @@ public class Ranges {
}
public static ShortRange downTo(short from, short to) {
if(from > to) {
if (from > to) {
return new ShortRange(from, to-from-1);
}
else {
@@ -171,7 +171,7 @@ public class Ranges {
}
public static IntRange upTo(short from, int to) {
if(from > to) {
if (from > to) {
return IntRange.empty;
}
else {
@@ -180,7 +180,7 @@ public class Ranges {
}
public static IntRange downTo(short from, int to) {
if(from > to) {
if (from > to) {
return new IntRange(from, to-from-1);
}
else {
@@ -189,7 +189,7 @@ public class Ranges {
}
public static LongRange upTo(short from, long to) {
if(from > to) {
if (from > to) {
return LongRange.empty;
}
else {
@@ -198,7 +198,7 @@ public class Ranges {
}
public static LongRange downTo(short from, long to) {
if(from > to) {
if (from > to) {
return new LongRange(from, to-from-1);
}
else {
@@ -223,7 +223,7 @@ public class Ranges {
}
public static ShortRange upTo(short from, char to) {
if(from > to) {
if (from > to) {
return ShortRange.empty;
}
else {
@@ -232,7 +232,7 @@ public class Ranges {
}
public static ShortRange downTo(short from, char to) {
if(from > to) {
if (from > to) {
return new ShortRange(from, to-from-1);
}
else {
@@ -241,7 +241,7 @@ public class Ranges {
}
public static IntRange upTo(int from, byte to) {
if(from > to) {
if (from > to) {
return IntRange.empty;
}
else {
@@ -250,7 +250,7 @@ public class Ranges {
}
public static IntRange downTo(int from, byte to) {
if(from > to) {
if (from > to) {
return new IntRange(from, to-from-1);
}
else {
@@ -259,7 +259,7 @@ public class Ranges {
}
public static IntRange upTo(int from, short to) {
if(from > to) {
if (from > to) {
return IntRange.empty;
}
else {
@@ -268,7 +268,7 @@ public class Ranges {
}
public static IntRange downTo(int from, short to) {
if(from > to) {
if (from > to) {
return new IntRange(from, to-from-1);
}
else {
@@ -277,7 +277,7 @@ public class Ranges {
}
public static IntRange upTo(int from, int to) {
if(from > to) {
if (from > to) {
return IntRange.empty;
}
else {
@@ -286,7 +286,7 @@ public class Ranges {
}
public static IntRange downTo(int from, int to) {
if(from > to) {
if (from > to) {
return new IntRange(from, to-from-1);
}
else {
@@ -295,7 +295,7 @@ public class Ranges {
}
public static LongRange upTo(int from, long to) {
if(from > to) {
if (from > to) {
return LongRange.empty;
}
else {
@@ -304,7 +304,7 @@ public class Ranges {
}
public static LongRange downTo(int from, long to) {
if(from > to) {
if (from > to) {
return new LongRange(from, to-from-1);
}
else {
@@ -329,7 +329,7 @@ public class Ranges {
}
public static IntRange upTo(int from, char to) {
if(from > to) {
if (from > to) {
return IntRange.empty;
}
else {
@@ -338,7 +338,7 @@ public class Ranges {
}
public static IntRange downTo(int from, char to) {
if(from > to) {
if (from > to) {
return new IntRange(from, to-from-1);
}
else {
@@ -347,7 +347,7 @@ public class Ranges {
}
public static LongRange upTo(long from, byte to) {
if(from > to) {
if (from > to) {
return LongRange.empty;
}
else {
@@ -356,7 +356,7 @@ public class Ranges {
}
public static LongRange downTo(long from, byte to) {
if(from > to) {
if (from > to) {
return new LongRange(from, to-from-1);
}
else {
@@ -365,7 +365,7 @@ public class Ranges {
}
public static LongRange upTo(long from, short to) {
if(from > to) {
if (from > to) {
return LongRange.empty;
}
else {
@@ -374,7 +374,7 @@ public class Ranges {
}
public static LongRange downTo(long from, short to) {
if(from > to) {
if (from > to) {
return new LongRange(from, to-from-1);
}
else {
@@ -383,7 +383,7 @@ public class Ranges {
}
public static LongRange upTo(long from, int to) {
if(from > to) {
if (from > to) {
return LongRange.empty;
}
else {
@@ -392,7 +392,7 @@ public class Ranges {
}
public static LongRange downTo(long from, int to) {
if(from > to) {
if (from > to) {
return new LongRange(from, to-from-1);
}
else {
@@ -401,7 +401,7 @@ public class Ranges {
}
public static LongRange upTo(long from, long to) {
if(from > to) {
if (from > to) {
return LongRange.empty;
}
else {
@@ -410,7 +410,7 @@ public class Ranges {
}
public static LongRange downTo(long from, long to) {
if(from > to) {
if (from > to) {
return new LongRange(from, to-from-1);
}
else {
@@ -435,7 +435,7 @@ public class Ranges {
}
public static LongRange upTo(long from, char to) {
if(from > to) {
if (from > to) {
return LongRange.empty;
}
else {
@@ -444,7 +444,7 @@ public class Ranges {
}
public static LongRange downTo(long from, char to) {
if(from > to) {
if (from > to) {
return new LongRange(from, to-from-1);
}
else {
@@ -565,7 +565,7 @@ public class Ranges {
}
public static CharRange upTo(char from, byte to) {
if(from > to) {
if (from > to) {
return CharRange.empty;
}
else {
@@ -574,7 +574,7 @@ public class Ranges {
}
public static CharRange downTo(char from, byte to) {
if(from > to) {
if (from > to) {
return new CharRange(from, to-from-1);
}
else {
@@ -583,7 +583,7 @@ public class Ranges {
}
public static ShortRange upTo(char from, short to) {
if(from > to) {
if (from > to) {
return ShortRange.empty;
}
else {
@@ -592,7 +592,7 @@ public class Ranges {
}
public static ShortRange downTo(char from, short to) {
if(from > to) {
if (from > to) {
return new ShortRange((short) from, to-from-1);
}
else {
@@ -601,7 +601,7 @@ public class Ranges {
}
public static IntRange upTo(char from, int to) {
if(from > to) {
if (from > to) {
return IntRange.empty;
}
else {
@@ -610,7 +610,7 @@ public class Ranges {
}
public static IntRange downTo(char from, int to) {
if(from > to) {
if (from > to) {
return new IntRange(from, to-from-1);
}
else {
@@ -619,7 +619,7 @@ public class Ranges {
}
public static LongRange upTo(char from, long to) {
if(from > to) {
if (from > to) {
return LongRange.empty;
}
else {
@@ -628,7 +628,7 @@ public class Ranges {
}
public static LongRange downTo(char from, long to) {
if(from > to) {
if (from > to) {
return new LongRange(from, to-from-1);
}
else {
@@ -653,7 +653,7 @@ public class Ranges {
}
public static CharRange upTo(char from, char to) {
if(from > to) {
if (from > to) {
return CharRange.empty;
}
else {
@@ -662,7 +662,7 @@ public class Ranges {
}
public static CharRange downTo(char from, char to) {
if(from > to) {
if (from > to) {
return new CharRange(from, to-from-1);
}
else {