public class FileData extends Object implements Comparable<FileData>
A simple data class representing a file (or sub directory) in a directory.
Objects of this type are used by the model of the table control. Each
instance represents one row in the table. An instance wraps a File
object and provides bean-style get methods for it. (The API of File
does not always conform to the Java Beans standard.)
| Constructor and Description |
|---|
FileData(File f,
Object icon)
Creates a new instance of
FileData for the specified File
object. |
FileData(String name,
Object icon)
Creates a new instance of
FileData that does not represent a
file. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(FileData o)
A special
compareTo() implementation. |
boolean |
equals(Object obj)
Compares this object with another one.
|
File |
getFile()
Returns the associated
File object. |
Object |
getIcon()
Returns the icon of this file.
|
Date |
getLastModified()
Returns the date this file was modified.
|
String |
getName()
Returns the name of this file.
|
long |
getSize()
Returns the size of this file.
|
int |
hashCode()
Returns a hash code for this object.
|
String |
toString()
Returns a string representation for this object.
|
public FileData(File f, Object icon)
FileData for the specified File
object.f - the Fileicon - the icon for this Filepublic File getFile()
File object. If this object represents a
special entry which is not associated with a file, result is null.File objectpublic Object getIcon()
public String getName()
public Date getLastModified()
public long getSize()
public boolean equals(Object obj)
FileData
are equal if they refer to the same file.public int hashCode()
public String toString()
public int compareTo(FileData o)
compareTo() implementation. Files are sorted
alphabetically by their names. Directories are sorted before plain files.compareTo in interface Comparable<FileData>o - the other FileData objectCopyright © 2016 The JGUIraffe Team. All Rights Reserved.