edu.UCL.xmiddle.host
Class LinkTableItem

java.lang.Object
  |
  +--edu.UCL.xmiddle.host.LinkTableItem

public class LinkTableItem
extends java.lang.Object

LinkTableItem.java Multi-purpose class used to hold data stored in a LinkTable. Note that because the type of item in the table changes, not all of the fields will be used for each item. To ensure compatibility with each type, some methods return the same value, but under a different name.


Field Summary
static short EXPORT
          This LinkTableItem is in an Export linktable (2 data items)
static short LINKED_BY
          This LinkTableItem is in a LinkedBy linktable (3 data items)
static short LINKED_FROM
          This LinkTableItem is in a LinkedFrom linktable (5 data items)
 
Constructor Summary
LinkTableItem(java.lang.Object primaryID, java.lang.String path, java.lang.Integer localAppID)
          Create a new LinkTableItem instance.
LinkTableItem(java.lang.Object primaryID, java.lang.String src, java.lang.String dest, java.lang.Integer remoteAppID, java.lang.Integer localAppID)
          Create a new LinkTableItem instance.
LinkTableItem(java.lang.String path, java.lang.Integer appID)
          Create a new LinkTableItem instance.
 
Method Summary
 java.lang.Integer getAppID()
          Return the application ID stored by this LinkTableItem.
 java.lang.String getDestinationPath()
          Return the destination path stored by this LinkTableItem.
 java.lang.Integer getLocalAppID()
          Return the local application ID stored by this LinkTableItem.
 java.lang.String getPath()
          Return the path stored by this LinkTableItem.
 java.lang.Object getPrimaryID()
          Return the primaryID stored by this LinkTableItem.
 java.lang.Integer getRemoteAppID()
          Return the remote application ID stored by this LinkTableItem.
 java.lang.String getSourcePath()
          Return the source path stored by this LinkTableItem.
 short getType()
          Return the type of this LinkTableItem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXPORT

public static final short EXPORT
This LinkTableItem is in an Export linktable (2 data items)

See Also:
Constant Field Values

LINKED_FROM

public static final short LINKED_FROM
This LinkTableItem is in a LinkedFrom linktable (5 data items)

See Also:
Constant Field Values

LINKED_BY

public static final short LINKED_BY
This LinkTableItem is in a LinkedBy linktable (3 data items)

See Also:
Constant Field Values
Constructor Detail

LinkTableItem

public LinkTableItem(java.lang.String path,
                     java.lang.Integer appID)
Create a new LinkTableItem instance. Used by an EXPORT type item.

Parameters:
appID - The ID of the application under the tree of which the element resides.

LinkTableItem

public LinkTableItem(java.lang.Object primaryID,
                     java.lang.String src,
                     java.lang.String dest,
                     java.lang.Integer remoteAppID,
                     java.lang.Integer localAppID)
Create a new LinkTableItem instance. Used by a LINKED_FROM type item.

Parameters:
primaryID - The primary ID of the remote host.
src - The remote element from which the local host linked.
dest - The local element under which the linked element was placed.
remoteAppID - The id of the remote application that exported the element.
localAppID - The id of the local application on the data. structure of which the remote element was linked.

LinkTableItem

public LinkTableItem(java.lang.Object primaryID,
                     java.lang.String path,
                     java.lang.Integer localAppID)
Create a new LinkTableItem instance. Used for a LINKED_BY type item

Parameters:
primaryID - The primaryID of the remote host
path - The element that was linked by the remote host
localAppID - The ID of the application under the tree of which the element that was linked by resides
Method Detail

getType

public short getType()
Return the type of this LinkTableItem

Returns:
A short int containing the type

getPrimaryID

public java.lang.Object getPrimaryID()
Return the primaryID stored by this LinkTableItem. Should be called only on LINKED_FROM and LINKED_BY type items, will return null otherwise

Returns:
An Object containing the primaryID, or null

getSourcePath

public java.lang.String getSourcePath()
Return the source path stored by this LinkTableItem. Should be called only on LINKED_FROM type items, EXPORT and LINKED_BY type items should call getPath()

Returns:
A String containing the source path

getPath

public java.lang.String getPath()
Return the path stored by this LinkTableItem. Should be called only on EXPORT and LINKED_BY type items, LINKED_FROM type items should call getSourcePath()

Returns:
A String containing the path

getDestinationPath

public java.lang.String getDestinationPath()
Return the destination path stored by this LinkTableItem. Should be called only on LINKED_FROM type items, will return null otherwise

Returns:
A String containing the destination path, or null

getLocalAppID

public java.lang.Integer getLocalAppID()
Return the local application ID stored by this LinkTableItem. Should be called only on LINKED_FROM and LINKED_BY type items, EXPORT type items should call getAppID()

Returns:
An Integer containing the local application ID

getAppID

public java.lang.Integer getAppID()
Return the application ID stored by this LinkTableItem. Should be called only on EXPORT type items, LINKED_FROM and LINKED_BY type items should call getLocalAppID()

Returns:
An Integer containing the application ID

getRemoteAppID

public java.lang.Integer getRemoteAppID()
Return the remote application ID stored by this LinkTableItem. Should be called only on LINKED_FROM type items, will return null otherwise

Returns:
An Integer containing the remote application ID, or null