renamed all modules

This commit is contained in:
Andy Clement
2014-01-15 11:36:24 -08:00
parent 342420b2ed
commit ceef61cf98
1055 changed files with 301 additions and 259 deletions

View File

@@ -0,0 +1,5 @@
package enumtests;
public enum Colours {
Red, Green, Blue;
}

View File

@@ -0,0 +1,5 @@
package enumtests;
public enum Colours2 {
Red, Green, Blue, Yellow;
}

View File

@@ -0,0 +1,16 @@
package enumtests;
public enum ColoursB implements Intface {
Red(111), Green(222), Blue(333);
int value;
private ColoursB(int i) {
this.value = i;
}
@Override
public int getIntValue() {
return value;
}
}

View File

@@ -0,0 +1,16 @@
package enumtests;
public enum ColoursB2 implements Intface {
Red(111), Green(222), Blue(333), Yellow(444);
int value;
private ColoursB2(int i) {
this.value = i * 2;
}
@Override
public int getIntValue() {
return value;
}
}

View File

@@ -0,0 +1,21 @@
package enumtests;
public enum ColoursB3 implements Intface3 {
Red(111), Green(222), Blue(333);
int value;
private ColoursB3(int i) {
this.value = i;
}
@Override
public int getIntValue() {
return value;
}
@Override
public int getDoubleIntValue() {
return value * 2;
}
}

View File

@@ -0,0 +1,5 @@
package enumtests;
public enum ColoursC {
Red, Green, Blue, Orange, Yellow;
}

View File

@@ -0,0 +1,5 @@
package enumtests;
public enum ColoursC2 {
Red, Green, Blue, Orange, Yellow, Magenta, Cyan;
}

View File

@@ -0,0 +1,15 @@
package enumtests;
public enum ColoursD {
Red(1111), Green(2222), Blue(3333);
int value;
private ColoursD(int i) {
this.value = i;
}
public int getIntValue() {
return value;
}
}

View File

@@ -0,0 +1,15 @@
package enumtests;
public enum ColoursD2 {
Red("aaa"), Green("bbb"), Blue("ccc");
char value;
private ColoursD2(String i) {
this.value = i.charAt(0);
}
public char getCharValue() {
return value;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,5 @@
package enumtests;
public interface Intface {
int getIntValue();
}

View File

@@ -0,0 +1,7 @@
package enumtests;
public interface Intface3 {
int getIntValue();
int getDoubleIntValue();
}

View File

@@ -0,0 +1,24 @@
package enumtests;
public class RunnerA {
public static void main(String[] args) {
run1();
}
public static void run1() {
System.out.println(Colours.Red);
System.out.println(Colours.Green);
System.out.println(Colours.Blue);
Colours[] colours = Colours.values();
System.out.print("[");
for (int i = 0; i < colours.length; i++) {
if (i > 0) {
System.out.print(" ");
}
System.out.print(colours[i]);
}
System.out.println("]");
System.out.println("value count = " + colours.length);
}
}

View File

@@ -0,0 +1,24 @@
package enumtests;
public class RunnerB {
public static void main(String[] args) {
run1();
}
public static void run1() {
System.out.println(ColoursB.Red.getIntValue());
System.out.println(ColoursB.Green.getIntValue());
System.out.println(ColoursB.Blue.getIntValue());
ColoursB[] colours = ColoursB.values();
System.out.print("[");
for (int i = 0; i < colours.length; i++) {
if (i > 0) {
System.out.print(" ");
}
System.out.print(colours[i].getIntValue());
}
System.out.println("]");
System.out.println("value count = " + colours.length);
}
}

View File

@@ -0,0 +1,24 @@
package enumtests;
public class RunnerB3 {
public static void main(String[] args) {
run1();
}
public static void run1() {
System.out.println(ColoursB3.Red.getIntValue());
System.out.println(ColoursB3.Green.getIntValue());
System.out.println(ColoursB3.Blue.getIntValue());
ColoursB3[] colours = ColoursB3.values();
System.out.print("[");
for (int i = 0; i < colours.length; i++) {
if (i > 0) {
System.out.print(" ");
}
System.out.print(colours[i].getDoubleIntValue());
}
System.out.println("]");
System.out.println("value count = " + colours.length);
}
}

View File

@@ -0,0 +1,47 @@
package enumtests;
public class RunnerC {
public static void main(String[] args) {
callGetEnumConstants();
}
public static void callGetEnumConstants() {
ColoursC[] values = ColoursC.class.getEnumConstants();
System.out.print("[");
for (int i = 0; i < values.length; i++) {
if (i > 0) {
System.out.print(" ");
}
System.out.print(values[i]);
}
System.out.println("]");
System.out.println("value count = " + values.length);
}
public static void callValueOf1() {
ColoursC[] values = ColoursC.class.getEnumConstants();
System.out.print("valueOf(String)=[");
for (int i = 0; i < values.length; i++) {
if (i > 0) {
System.out.print(" ");
}
System.out.print(ColoursC.valueOf(values[i].toString()));
}
System.out.println("]");
System.out.println("value count = " + values.length);
}
public static void callValueOf2() {
ColoursC[] values = ColoursC.class.getEnumConstants();
System.out.print("valueOf(String)=[");
for (int i = 0; i < values.length; i++) {
if (i > 0) {
System.out.print(" ");
}
System.out.print(Enum.valueOf(ColoursC.class, values[i].toString()));
}
System.out.println("]");
System.out.println("value count = " + values.length);
}
}

View File

@@ -0,0 +1,21 @@
package enumtests;
public class RunnerD {
public static void main(String[] args) {
run1();
}
public static void run1() {
ColoursD[] colours = ColoursD.values();
System.out.print("[");
for (int i = 0; i < colours.length; i++) {
if (i > 0) {
System.out.print(" ");
}
System.out.print(colours[i] + " " + colours[i].getIntValue() + " " + colours[i].ordinal());
}
System.out.println("]");
System.out.println("value count = " + colours.length);
}
}

View File

@@ -0,0 +1,21 @@
package enumtests;
public class RunnerD2 {
public static void main(String[] args) {
run1();
}
public static void run1() {
ColoursD2[] colours = ColoursD2.values();
System.out.print("[");
for (int i = 0; i < colours.length; i++) {
if (i > 0) {
System.out.print(" ");
}
System.out.print(colours[i] + " " + colours[i].getCharValue() + " " + colours[i].ordinal());
}
System.out.println("]");
System.out.println("value count = " + colours.length);
}
}

View File

@@ -0,0 +1,21 @@
package enumtests;
public class RunnerE {
public static void main(String[] args) {
run1();
}
public static void run1() {
ColoursD[] colours = ColoursD.values();
System.out.print("[");
for (int i = 0; i < colours.length; i++) {
if (i > 0) {
System.out.print(" ");
}
System.out.print(colours[i] + " " + colours[i].getIntValue() + " " + colours[i].ordinal());
}
System.out.println("]");
System.out.println("value count = " + colours.length);
}
}

View File

@@ -0,0 +1,21 @@
package enumtests;
public class RunnerE2 {
public static void main(String[] args) {
run1();
}
public static void run1() {
ColoursD2[] colours = ColoursD2.values();
System.out.print("[");
for (int i = 0; i < colours.length; i++) {
if (i > 0) {
System.out.print(" ");
}
System.out.print(colours[i] + " " + colours[i].getCharValue() + " " + colours[i].ordinal());
}
System.out.println("]");
System.out.println("value count = " + colours.length);
}
}