GeoSoft API

no.geosoft.cc.directory
Class DirectoryEntry

Object
  |
  +--DirectoryEntry
All Implemented Interfaces:
Comparable
Direct Known Subclasses:
DirectoryItem, Folder, SymbolicLink

public abstract class DirectoryEntry
extends Object
implements Comparable

An abstract class representing an entry in a generic directory structure. To an entry there is associated a back-end object, the item, which is client specific.

Author:
GeoSoft

Constructor Summary
DirectoryEntry(Object item)
          Create a directory entry with name according to the item toString().
DirectoryEntry(Object item, String name)
          Create a directory entry.
 
Method Summary
 int compareTo(Object object)
          Compare names of the two entries.
 boolean equals(Object object)
          Return true if this entry equals the specified entry.
 Object getItem()
          Get item of this entry.
 String getName()
          Get name of this entry.
 Folder getParent()
          Get parent of this entry.
 Object[] getPath()
          Return the path structure of this entry.
 boolean isFolder()
          Return true if this is a folder entry.
abstract  boolean isLeaf()
          Return true if this is a leaf entry.
abstract  void print(int indent)
           
 void setItem(Object item)
          Set the item of this entry.
 void setName(String name)
          Set name of this entry.
 String toString()
          Represent this entry as a string.
 
Methods inherited from class Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DirectoryEntry

public DirectoryEntry(Object item,
                      String name)
Create a directory entry.

Parameters:
item - Item contained in this directory entry.
name - Name of this directory entry.

DirectoryEntry

public DirectoryEntry(Object item)
Create a directory entry with name according to the item toString().

Parameters:
item - Item contained in this directory entry.
Method Detail

compareTo

public int compareTo(Object object)
Compare names of the two entries.

Specified by:
compareTo in interface Comparable
Parameters:
object - Object to compare to.
Returns:
@see String.compareTo()

equals

public boolean equals(Object object)
Return true if this entry equals the specified entry.

Overrides:
equals in class Object
Parameters:
object - Object to compare to.
Returns:
True if thw two equals, false otherwise.

isLeaf

public abstract boolean isLeaf()
Return true if this is a leaf entry.

Returns:
True if this is a leaf entry, false otherwise.

isFolder

public boolean isFolder()
Return true if this is a folder entry.

Returns:
True if this is a folder entry, false otherwise.

setName

public void setName(String name)
Set name of this entry.

Parameters:
name -

getName

public String getName()
Get name of this entry.

Returns:

toString

public String toString()
Represent this entry as a string.

Overrides:
toString in class Object
Returns:
String representation of this entry.

setItem

public void setItem(Object item)
Set the item of this entry.

Parameters:
item - Item of this entry.

getItem

public Object getItem()
Get item of this entry.

Returns:
Item of this entry.

getParent

public Folder getParent()
Get parent of this entry.

Returns:
Parent folder of this entry.

getPath

public Object[] getPath()
Return the path structure of this entry. The array is suitable for use with the TreePath class.

Returns:
Array of acenstor entries.

print

public abstract void print(int indent)

GeoSoft API

Copyright © 2004 - Geotechnical Software Services     geosoft.no