Thread: Casting Help
View Single Post
Old 10-29-07, 11:51 AM   #1
jcrox
Mahna Mahna
 
jcrox's Avatar
 
Join Date: Jul 2006
Location: Madison, Wi
Posts: 6,134
Default Casting Help

Java:

I have an Interface called Analyzer and 3 classes that implement the interface. In the processing class I want to loop an Arraylist of the objects and call the methods they implement from the Interface... I know I can do this with the newest version of java:

private Arraylist<Analyzer> list = new Arraylist<Analyzer>;

SummaryReport summary = new SummaryReport();
UniqueToken token = new UniqueToken();
TokenCount count = new TokenCount();

list.add(summary);
list.add(token);
list.add(count);

for (Analyzer item : list) {
processToken();
}

but how do I do that same thing for older versions of java?? help anyone??
__________________

Gaming

MSI MPower Z87 | 4770k | CNPS9900MAX-B | 8GB G.Skill 1866 | EVGA GTX760 |ThermalTake 850w | X-Fi Titanium | HAF | Asus PA248Q | Lycosa | Death Adder | Win8 Pro 64

Dev/Backup

MSI GD65 | 2500k | H50 | 8GB G.skill | GTX570 | Ubuntu 13.10

Laptop

17" Inspiron | i5 | 4GB DDR3 | 500GB HDD | Win7 Pro 64

jcrox is offline   Reply With Quote