M
Mize-ze
Hi,
I remember that I saw a code somewhere that sends an inline class as an
argument but for some reason I cant find any examples now when I
search for it on the web.
It looked something like that:
String files[] = xmlpath.list(
new class myFilter implements java.io.FilenameFilter
{
//Overriden method
public boolean accept(File dir,String name)
{
if
(dir.getAbsolutePath().equals(xmlRuleProvider.XMLPATH.toString())&&
name.endsWith(".xml") )
return true;
else
return false;
}
} //end of class decleration and (hopefully) instansiating
);
But the above code does not compile,
can someone refer me to a good example?
Thanks.
I remember that I saw a code somewhere that sends an inline class as an
argument but for some reason I cant find any examples now when I
search for it on the web.
It looked something like that:
String files[] = xmlpath.list(
new class myFilter implements java.io.FilenameFilter
{
//Overriden method
public boolean accept(File dir,String name)
{
if
(dir.getAbsolutePath().equals(xmlRuleProvider.XMLPATH.toString())&&
name.endsWith(".xml") )
return true;
else
return false;
}
} //end of class decleration and (hopefully) instansiating
);
But the above code does not compile,
can someone refer me to a good example?
Thanks.