public class Folder extends java.lang.Object implements java.lang.Comparable, Deleteable, java.awt.datatransfer.Transferable
Modifier and Type | Field and Description |
---|---|
(package private) static java.awt.datatransfer.DataFlavor[] |
flavors |
static java.awt.datatransfer.DataFlavor |
INFO_FLAVOR |
static org.apache.log4j.Logger |
log
Used for logging.
|
Constructor and Description |
---|
Folder(int folderID,
java.lang.String name)
Generates a folder object with the given name and ID.
|
Folder(java.lang.String name)
Generates a folder object with the given name.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(java.lang.Object child)
Adds a child to the folder.
|
int |
compareTo(java.lang.Object object)
Required by the
Comparable interface. |
void |
delete()
Deletes this folder from the database.
|
void |
deleteChildren()
Deletes all objects found within this folder.
|
boolean |
equals(java.lang.Object object)
Overriding equals...
|
java.lang.Object |
getChildObjectBySequence(int sequence)
Gets the object corresponding to the sequence.
|
java.util.Iterator |
getChildrenIterator()
Provides access to an
Iterator allowing
the children to be cycled over. |
int |
getID()
Gets the database ID of the folder.
|
java.lang.String |
getName()
Gets the name of the folder.
|
int |
getNumChildren()
Gets the number of child folders.
|
Folder |
getParentFolder()
Gets the parent folder.
|
static Folder |
getRootFolder()
Gets the root folder of the tree.
|
java.lang.Object |
getTransferData(java.awt.datatransfer.DataFlavor df) |
java.awt.datatransfer.DataFlavor[] |
getTransferDataFlavors() |
boolean |
hasChildren()
Indicates whether or not the folder has child folders.
|
boolean |
isDataFlavorSupported(java.awt.datatransfer.DataFlavor df)
Transferable methods.
|
void |
moveChildrenToRootFolder()
Moves all child objects to the root folder.
|
void |
removeAllChildren()
Clears all children out of the folder.
|
void |
removeChild(java.lang.Object child)
Removes a child object from the folder.
|
void |
save()
Saves the folder to the database.
|
void |
setName(java.lang.String name)
Sets the name of the folder.
|
void |
setParentFolder(Folder parentFolder)
Sets the parent folder.
|
java.lang.String |
toString()
A string representation of the folder.
|
public static org.apache.log4j.Logger log
public static final java.awt.datatransfer.DataFlavor INFO_FLAVOR
static java.awt.datatransfer.DataFlavor[] flavors
public Folder(java.lang.String name)
name
- The name of the folder.public Folder(int folderID, java.lang.String name)
folderID
- The database ID of the folder.name
- The name of the folder.public int getID()
public java.lang.String getName()
public void setName(java.lang.String name)
name
- The name.public Folder getParentFolder()
public void setParentFolder(Folder parentFolder)
parentFolder
- The parent folder.public java.util.Iterator getChildrenIterator()
Iterator
allowing
the children to be cycled over.Iterator
.public int getNumChildren()
public java.lang.Object getChildObjectBySequence(int sequence)
sequence
- The sequence.public void addChild(java.lang.Object child)
child
- A ScrapingSession
, Script
,
or Folder
.public void removeChild(java.lang.Object child)
child
- The child object to remove.public boolean hasChildren()
public void removeAllChildren()
public void save()
public static Folder getRootFolder()
Folder
.public void delete()
delete
in interface Deleteable
public void moveChildrenToRootFolder()
public void deleteChildren()
public int compareTo(java.lang.Object object)
Comparable
interface.compareTo
in interface java.lang.Comparable
object
- The object to compare to.public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- The object we're comparing.public java.lang.String toString()
toString
in class java.lang.Object
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor df)
isDataFlavorSupported
in interface java.awt.datatransfer.Transferable
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor df) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException
getTransferData
in interface java.awt.datatransfer.Transferable
java.awt.datatransfer.UnsupportedFlavorException
java.io.IOException
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
getTransferDataFlavors
in interface java.awt.datatransfer.Transferable