databionics.project
Class FileSlot

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.AbstractSequentialList<E>
              extended by java.util.LinkedList
                  extended by databionics.project.FileSlot
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.Queue

public class FileSlot
extends java.util.LinkedList

A FileSlot holds several filenames for a FileType.

See Also:
Serialized Form

Field Summary
protected  boolean autoload
          automatically load file when name is set
protected  BaseFile file
          the data of the first file in this slot
protected static org.apache.log4j.Logger log
          log4j logging
protected  int max
          maximum size of history
protected  FileType type
          this slot contains filenames of this type
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
FileSlot()
          Default constructor
FileSlot(boolean autoload, int max)
          Constructor without type
FileSlot(FileType type)
          Constructor with type
FileSlot(FileType type, boolean autoload, int max)
          Constructor with all parameters
 
Method Summary
 BaseFile getFile()
          Get the file object
 int getMax()
           
 java.lang.String getName()
          Get the first filename in the slot
 java.lang.String getName(int index)
          Get a filename
 FileType getType()
          Get the file type
 boolean load()
          Load the data of the first file in the slot
 void rename(java.lang.String filename)
          Rename first file in this slot
 void reset()
          empty the slot
 boolean save()
          Save the data of the first file in the slot
 void setFile(BaseFile file)
          Set the file object
 void setMax(int i)
          sets the max number of history elements
 boolean setName(java.lang.String filename)
          Add a file to this slot
 void setType(FileType t)
          Set filetype
 java.lang.String toXml(java.lang.String dir)
          write a fileSlot in a string in xml-format
static FileSlot valueOf(org.w3c.dom.Element el, java.lang.String dir)
          load a slot out of the xml-tag
 
Methods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, peek, poll, remove, remove, remove, removeFirst, removeLast, set, size, toArray, toArray
 
Methods inherited from class java.util.AbstractSequentialList
iterator
 
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList
 

Field Detail

log

protected static org.apache.log4j.Logger log
log4j logging


type

protected FileType type
this slot contains filenames of this type


file

protected BaseFile file
the data of the first file in this slot


autoload

protected boolean autoload
automatically load file when name is set


max

protected int max
maximum size of history

Constructor Detail

FileSlot

public FileSlot()
Default constructor


FileSlot

public FileSlot(FileType type)
Constructor with type

Parameters:
type - FileType of the slot

FileSlot

public FileSlot(boolean autoload,
                int max)
Constructor without type

Parameters:
autoload - flag whether data is loaded when name is set
max - maximum number of filename to remember

FileSlot

public FileSlot(FileType type,
                boolean autoload,
                int max)
Constructor with all parameters

Parameters:
type - FileType of the slot
autoload - flag whether data is loaded when name is set
max - maximum number of filename to remember
Method Detail

getType

public FileType getType()
Get the file type

Returns:
FileType

setType

public void setType(FileType t)
Set filetype

Parameters:
t - - corresponing FileType

getName

public java.lang.String getName(int index)
Get a filename

Parameters:
index - of the file in the slot
Returns:
path of file

getName

public java.lang.String getName()
Get the first filename in the slot

Returns:
path of file

getFile

public BaseFile getFile()
Get the file object

Returns:
BDMFile object

setFile

public void setFile(BaseFile file)
Set the file object


setName

public boolean setName(java.lang.String filename)
Add a file to this slot

Parameters:
filename - - path of the file return if autoload is true success of loading otherwise true

rename

public void rename(java.lang.String filename)
Rename first file in this slot

Parameters:
filename - - new file path

load

public boolean load()
Load the data of the first file in the slot

Returns:
success of loading

save

public boolean save()
Save the data of the first file in the slot

Returns:
success of saveing

reset

public void reset()
empty the slot


valueOf

public static FileSlot valueOf(org.w3c.dom.Element el,
                               java.lang.String dir)
load a slot out of the xml-tag

Parameters:
el - - Element of the xml-document
Returns:
loaded FileSlot

toXml

public java.lang.String toXml(java.lang.String dir)
write a fileSlot in a string in xml-format


getMax

public int getMax()
Returns:
the max number of history elements

setMax

public void setMax(int i)
sets the max number of history elements

Parameters:
i -


Copyright © 2005-2006 Databionics Research Group. All Rights Reserved.