Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

RSE
Release 3.0

org.eclipse.rse.core.filters
Class SystemFilterReference


java.lang.Object
  extended by 

org.eclipse.rse.core.model.RSEPersistableObject
      extended by 

org.eclipse.rse.core.model.PropertySetContainer
          extended by 

org.eclipse.rse.core.model.RSEModelObject
              extended by 

org.eclipse.rse.core.references.SystemReferencingObject
                  extended by 
org.eclipse.rse.core.filters.SystemFilterReference
All Implemented Interfaces:
IAdaptable, ISystemFilterContainerReference, ISystemFilterReference, IPropertySetContainer, IRSEModelObject, IRSEPersistableContainer, ISystemContainer, IRSEBaseReferencingObject, IRSEReferencingObject

public class SystemFilterReference
extends SystemReferencingObject
implements IAdaptable, ISystemFilterReference

Represents a shadow or reference to a system filter. Such references are only transient, not savable to disk. All major function is inherited.

SystemFilter references typically exist for only one reason:

  1. As a simple shadow to enable a unique object in a GUI tree. For example, if it is possible for the same filter to show up in different places in the tree, then we must create shadows for each place it shows up.


Field Summary
protected   ISubSystem _subSystem
           
protected   HashMap cachedContents
           
protected  boolean isStale
           
protected  boolean persistent
           
static boolean PERSISTENT_NO
           
static boolean PERSISTENT_YES
           
 
Fields inherited from class org.eclipse.rse.core.references. SystemReferencingObject
referenceBroken
 
Fields inherited from interface org.eclipse.rse.core.model. IRSEPersistableContainer
NO_CHILDREN
 
Constructor Summary
protected SystemFilterReference ()
          Constructor.
 
Method Summary
 boolean commit ()
          Request a persistence manager to persist this object.
static  ISystemFilterReference createSystemFilterReference ( ISubSystem subSystem, ISystemFilterContainerReference parent, ISystemFilter filter, boolean persistent)
          Create a new instance of this class.
  Object getAdapter ( Class adapterType)
          This is the method required by the IAdaptable interface.
  Object[] getContents ( ISystemContentsType contentsType)
          Returns all the contents of the object (combining results of all filters
  ISystemFilterReference getExistingSystemFilterReference ( ISubSystem subSystem, ISystemFilter filter)
          Return an existing reference to a given system filter.
 int getFilterCount ()
          Return count of the number of filters in the referenced pool or filter
  ISystemFilterPoolReferenceManager getFilterPoolReferenceManager ()
          Return the reference manager which is managing this filter reference framework object.
  String getName ()
          Return the name of the SystemFilter or SystemFilterPool that we reference.
  ISystemFilterContainerReference getParent ()
          The parent will either by a SystemFilterPoolReference or a SystemFilterReference.
  ISystemFilterPoolReference getParentSystemFilterReferencePool ()
          If this is a reference to a nested filter, the parent is the reference to the nested filter's parent.
  IRSEPersistableContainer[] getPersistableChildren ()
          Retrieves the children of this object in the persistence containment hierarchy.
  IRSEPersistableContainer getPersistableParent ()
          Retrieve the parent of this object in the persistence containment hierarchy.
  ISystemFilterPoolReferenceManagerProvider getProvider ()
          Return the object which instantiated the pool reference manager object.
  ISystemFilter getReferencedFilter ()
          Return the filter to which we reference...
  IRSEBaseReferencedObject getReferencedObject ()
          Get the object which we reference.
  ISystemFilterContainer getReferencedSystemFilterContainer ()
          Return the object to which we hold a reference.
  ISubSystem getSubSystem ()
          Gets the subsystem that contains this reference
  ISystemFilterReference getSystemFilterReference ( ISubSystem subSystem, ISystemFilter filter)
          Create a single filter refererence to a given filter.
  ISystemFilterReference[] getSystemFilterReferences ( ISubSystem subSystem)
          Build and return an array of SystemFilterReference objects.
 int getSystemFilterStringCount ()
          Return the number of filter strings in the referenced filter
  ISystemFilterStringReference getSystemFilterStringReference ( ISystemFilterString filterString)
          Create a single filter string refererence to a given filter string
  ISystemFilterStringReference[] getSystemFilterStringReferences ()
          Get the filter strings contained by this filter.
 boolean hasContents ( ISystemContentsType contentsType)
          Returns whether the object has contents of a particular type.
 boolean hasFilters ()
          Return true if the referenced pool or filter has filters.
 boolean isStale ()
          Indicates whether the cached object is stale
 void markStale (boolean isStale)
          Marks the object as stale or not
 void markStale (boolean isStale, boolean clearCache)
          Marks the object as stale or not
 int removeReference ()
          Fastpath to getReferencedObject().removeReference(this).
 void setContents ( ISystemContentsType type, Object[] cachedContents)
           
 void setParent ( ISystemFilterContainerReference parent)
          If this is a reference to a nested filter, the parent is the reference to the nested filter's parent.
 void setReferencedFilter ( ISystemFilter filter)
          Set the filter to which we reference...
 void setReferencedObject ( IRSEBaseReferencedObject obj)
          Set the object to which we reference.
 void setSubSystem ( ISubSystem subSystem)
          Sets the subsystem that contains this reference
  String toString ()
          Override of Object method.
 
Methods inherited from class org.eclipse.rse.core.references. SystemReferencingObject
getDescription, getHelper, isReferenceBroken, setReferenceBroken
 
Methods inherited from class org.eclipse.rse.core.model. PropertySetContainer
addPropertySet, addPropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet
 
Methods inherited from class org.eclipse.rse.core.model. RSEPersistableObject
compareStrings, isDirty, isTainted, setDirty, setTainted, setWasRestored, wasRestored
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.rse.core.references. IRSEBaseReferencingObject
isReferenceBroken, setReferenceBroken
 
Methods inherited from interface org.eclipse.rse.core.model. IPropertySetContainer
addPropertySet, addPropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet
 
Methods inherited from interface org.eclipse.rse.core.model. IRSEPersistableContainer
isDirty, isTainted, setDirty, setTainted, setWasRestored, wasRestored
 

Field Detail

persistent

protected boolean persistent

isStale

protected boolean isStale

_subSystem

protected 
ISubSystem _subSystem

cachedContents

protected 
HashMap cachedContents

PERSISTENT_YES

public static final boolean PERSISTENT_YES
See Also:
Constant Field Values

PERSISTENT_NO

public static final boolean PERSISTENT_NO
See Also:
Constant Field Values
Constructor Detail

SystemFilterReference

protected SystemFilterReference()
Constructor.

Method Detail

createSystemFilterReference

public static 
ISystemFilterReference createSystemFilterReference(
ISubSystem subSystem,
                                                                 
ISystemFilterContainerReference parent,
                                                                 
ISystemFilter filter,
                                                                 boolean persistent)
Create a new instance of this class.

Parameters:
parent - The SystemFilterReference or SystemFilterPoolReference object that we are a child of.
filter - The master object to be referenced.
persistent - Whether we should formally register our reference with the target filter or not.

getSubSystem

public 
ISubSystem getSubSystem()
Gets the subsystem that contains this reference

Specified by:
getSubSystem in interface ISystemFilterReference
Returns:
the subsystem

setSubSystem

public void setSubSystem(
ISubSystem subSystem)
Sets the subsystem that contains this reference

Specified by:
setSubSystem in interface ISystemFilterReference
Parameters:
subSystem - the subsystem that holds this reference

getFilterPoolReferenceManager

public 
ISystemFilterPoolReferenceManager getFilterPoolReferenceManager()
Return the reference manager which is managing this filter reference framework object.

Specified by:
getFilterPoolReferenceManager in interface ISystemFilterReference

getProvider

public 
ISystemFilterPoolReferenceManagerProvider getProvider()
Return the object which instantiated the pool reference manager object. Makes it easy to get back to the point of origin, given any filter reference framework object

Specified by:
getProvider in interface ISystemFilterReference

setParent

public void setParent(
ISystemFilterContainerReference parent)
If this is a reference to a nested filter, the parent is the reference to the nested filter's parent. Else, it is the reference to the parent filter pool


getParent

public 
ISystemFilterContainerReference getParent()
The parent will either by a SystemFilterPoolReference or a SystemFilterReference.

Specified by:
getParent in interface ISystemFilterReference

getReferencedFilter

public 
ISystemFilter getReferencedFilter()
Return the filter to which we reference...

Specified by:
getReferencedFilter in interface ISystemFilterReference

setReferencedFilter

public void setReferencedFilter(
ISystemFilter filter)
Set the filter to which we reference...

Specified by:
setReferencedFilter in interface ISystemFilterReference

getParentSystemFilterReferencePool

public 
ISystemFilterPoolReference getParentSystemFilterReferencePool()
If this is a reference to a nested filter, the parent is the reference to the nested filter's parent. Else, it is the reference to the parent filter pool

Specified by:
getParentSystemFilterReferencePool in interface ISystemFilterReference

getAdapter

public 
Object getAdapter(
Class adapterType)
This is the method required by the IAdaptable interface. Given an adapter class type, return an object castable to the type, or null if this is not possible.

Specified by:
getAdapter in interface IAdaptable

getReferencedSystemFilterContainer

public 
ISystemFilterContainer getReferencedSystemFilterContainer()
Return the object to which we hold a reference. This is either SystemFilter or SystemFilterPool. Since both implement SystemFilterContainer, that is what we return.

Of course, this is a generic method, and in our case it is always true that we only hold a SystemFilter. Hence, this is the same as calling getReferenceFilter and casting the result.

Specified by:
getReferencedSystemFilterContainer in interface ISystemFilterContainerReference
Returns:
the filter container object which is referenced.

getSystemFilterReferences

public 
ISystemFilterReference[] getSystemFilterReferences(
ISubSystem subSystem)
Build and return an array of SystemFilterReference objects. Each object is created new. There is one for each of the filters in the reference SystemFilter or SystemFilterPool. For performance reasons, we will cache this array and only return a fresh one if something changes in the underlying filter list.

Specified by:
getSystemFilterReferences in interface ISystemFilterContainerReference
Parameters:
subSystem - the subsystem from which to get the filter references.

getSystemFilterReference

public 
ISystemFilterReference getSystemFilterReference(
ISubSystem subSystem,
                                                       
ISystemFilter filter)
Create a single filter refererence to a given filter. If there already is a reference to this filter, it is returned. If not, a new reference is created and appended to the end of the existing filter reference array.

Specified by:
getSystemFilterReference in interface ISystemFilterContainerReference
Parameters:
subSystem - the subsystem in which to find or create the filter.
filter - the filter to for which to create a reference.
See Also:
getExistingSystemFilterReference(ISubSystem, ISystemFilter)

getExistingSystemFilterReference

public 
ISystemFilterReference getExistingSystemFilterReference(
ISubSystem subSystem,
                                                               
ISystemFilter filter)
Return an existing reference to a given system filter. If no reference currently exists to this filter, returns null.

Specified by:
getExistingSystemFilterReference in interface ISystemFilterContainerReference
Parameters:
subSystem - the subsystem in which to look for the filter reference.
filter - the filter for which to look.
Returns:
an existing reference to a given system filter. If no reference currently exists to this filter, returns null.
See Also:
getSystemFilterReference(ISubSystem, ISystemFilter)

hasFilters

public boolean hasFilters()
Return true if the referenced pool or filter has filters.

Specified by:
hasFilters in interface ISystemFilterContainerReference
Returns:
true if this container has filters.

getFilterCount

public int getFilterCount()
Return count of the number of filters in the referenced pool or filter

Specified by:
getFilterCount in interface ISystemFilterContainerReference
Returns:
the number of filters in the referenced container

getName

public 
String getName()
Return the name of the SystemFilter or SystemFilterPool that we reference. For such objects this is what we show in the GUI.

Specified by:
getName in interface ISystemFilterContainerReference
Specified by:
getName in interface IRSEModelObject
Returns:
the name of the SystemFilter or SystemFilterPool that we reference.

toString

public 
String toString()
Override of Object method. Turn this filter in an outputable string

Overrides:
toString in class Object

getSystemFilterStringCount

public int getSystemFilterStringCount()
Return the number of filter strings in the referenced filter

Specified by:
getSystemFilterStringCount in interface ISystemFilterReference

getSystemFilterStringReferences

public 
ISystemFilterStringReference[] getSystemFilterStringReferences()
Get the filter strings contained by this filter. But get references to each, not the masters.

Specified by:
getSystemFilterStringReferences in interface ISystemFilterReference

getSystemFilterStringReference

public 
ISystemFilterStringReference getSystemFilterStringReference(
ISystemFilterString filterString)
Create a single filter string refererence to a given filter string

Specified by:
getSystemFilterStringReference in interface ISystemFilterReference

setReferencedObject

public void setReferencedObject(
IRSEBaseReferencedObject obj)
Set the object to which we reference. Override of inherited

Specified by:
setReferencedObject in interface IRSEBaseReferencingObject
Overrides:
setReferencedObject in class SystemReferencingObject
Parameters:
obj - the object to reference

getReferencedObject

public 
IRSEBaseReferencedObject getReferencedObject()
Get the object which we reference. Override of inherited

Specified by:
getReferencedObject in interface IRSEBaseReferencingObject
Overrides:
getReferencedObject in class SystemReferencingObject
Returns:
the object which we reference

removeReference

public int removeReference()
Fastpath to getReferencedObject().removeReference(this).

Specified by:
removeReference in interface IRSEBaseReferencingObject
Overrides:
removeReference in class SystemReferencingObject
Returns:
new reference count of master object

hasContents

public boolean hasContents(
ISystemContentsType contentsType)
Description copied from interface: ISystemContainer
Returns whether the object has contents of a particular type.

Specified by:
hasContents in interface ISystemContainer
Parameters:
contentsType - type of contents
Returns:
true if the object has contents, false otherwise.

getContents

public 
Object[] getContents(
ISystemContentsType contentsType)
Description copied from interface: ISystemContainer
Returns all the contents of the object (combining results of all filters

Specified by:
getContents in interface ISystemContainer
Parameters:
contentsType - type of contents
Returns:
an array of contents.

setContents

public void setContents(
ISystemContentsType type,
                        
Object[] cachedContents)
Specified by:
setContents in interface ISystemFilterReference

isStale

public boolean isStale()
Description copied from interface: ISystemContainer
Indicates whether the cached object is stale

Specified by:
isStale in interface ISystemContainer
Returns:
whether the container is stale

markStale

public void markStale(boolean isStale)
Description copied from interface: ISystemContainer
Marks the object as stale or not

Specified by:
markStale in interface ISystemContainer
Parameters:
isStale - whether the object is to be marked stale or not

markStale

public void markStale(boolean isStale,
                      boolean clearCache)
Description copied from interface: ISystemContainer
Marks the object as stale or not

Specified by:
markStale in interface ISystemContainer
Parameters:
isStale - whether the object is to be marked stale or not
clearCache - indicates whether or not to clear the cache

commit

public boolean commit()
Description copied from interface: IRSEPersistableContainer
Request a persistence manager to persist this object.

Specified by:
commit in interface IRSEPersistableContainer
Returns:
true if the object was persisted.

getPersistableParent

public 
IRSEPersistableContainer getPersistableParent()
Description copied from interface: IRSEPersistableContainer
Retrieve the parent of this object in the persistence containment hierarchy. This is related to, but not necessarily the same as, the model hierarchy.

Specified by:
getPersistableParent in interface IRSEPersistableContainer
Returns:
the parent persistent object. This is null if there is no parent.

getPersistableChildren

public 
IRSEPersistableContainer[] getPersistableChildren()
Description copied from interface: IRSEPersistableContainer
Retrieves the children of this object in the persistence containment hierarchy. This is related to, but not necessarily the same as, the model hierarchy.

Specified by:
getPersistableChildren in interface IRSEPersistableContainer
Returns:
the array of persistent children in the order they are to be stored in the persistent form. This is an empty array if there are no children. See IRSEPersistableContainer.NO_CHILDREN.

RSE
Release 3.0

Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire