¿Por que no compila este código?

ipadilla
04 de Febrero del 2010
¿Alguien me pude decir por qué no se compila esta clase java con la versión SDK6 de SUN?
Parece ser que con alguna versión anterior compilaba bien.

javac FileElement.java

//===================== FileElement.java =========================

package org.jfm.views;

import java.io.File;

public class FileElement extends File
implements Comparable
{

public FileElement(String pathname)
{
this(pathname, false);
}

public FileElement(String pathname, boolean topFile)
{
super(pathname);
setTopFile(topFile);
}

public String toString()
{
if(isTopFile())
return "..";
else
return getName();
}

public void setTopFile(boolean topFile)
{
this.topFile = topFile;
}

public boolean isTopFile()
{
return topFile;
}

public FileElement getRootFile()
{
return getRootFile(this);
}

private FileElement getRootFile(FileElement f)
{
String parentPath = f.getParent();
if(parentPath == null)
{
return f;
} else
{
FileElement parent = new FileElement(parentPath);
return getRootFile(parent);
}
}

public int compareTo(Object o)
{
FileElement el = (FileElement)o;
if(isDirectory() && !el.isDirectory())
return -1;
if(!isDirectory() && el.isDirectory())
return 1;
else
return toString().compareTo(el.toString());
}

private boolean topFile;
}


ipadilla
04 de Febrero del 2010
solicito perdón por no haber puesto el error que me envía el compilador, es el siguiente:



D:Java File ManagerjfmsrcorgjfmviewsFileElement.java:10: java.lang.Comparable cannot be inherited with different arguments: <> and <java.io.File>
public class FileElement extends File
1 error

El error lo da en esta línea:
public class FileElement extends File implements Comparable

ipadilla