pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.site.content.filter
Class Filter

java.lang.Object
  extended by org.torweg.pulse.util.entity.AbstractBasicEntity
      extended by org.torweg.pulse.util.entity.AbstractNamedEntity
          extended by org.torweg.pulse.util.entity.AbstractNamableEntity
              extended by org.torweg.pulse.site.content.filter.Filter
All Implemented Interfaces:
java.io.Serializable, JDOMable, INameable, INamed

@Entity
public class Filter
extends AbstractNamableEntity
implements INameable, JDOMable

allows the filtering of ContentLocalizationMaps.

A Filter contains a set of FilterRules which describe characteristics of the filtered ContentLocalizationMap s. Each FilterRule has a set of FilterRuleProperty which describe the pecularity of the characteristic.

For each ContentLocalizationMap a FilterMatches is added to the Filter which maps the ContentLocalizationMap to its matching FilterRuleProperty objects.

Version:
$Revision: 1760 $
Author:
Thomas Weber, Daniel Dietz
See Also:
Serialized Form

Constructor Summary
protected Filter()
          Deprecated. 
  Filter(java.lang.String n)
          creates a new ContentFilter with the given name.
 
Method Summary
 boolean addMatches(FilterMatches m)
          adds a FilterMatches to the Filter.
 void addMatches(int index, FilterMatches element)
          adds a new FilterMatches at the given index.
 boolean addRule(FilterRule r)
          adds a FilterRule to the Filter.
 void addRule(int index, FilterRule element)
          adds a new FilterRule at the given index.
 void clearMatches()
          removes all FilterMatches from the Filter.
 void clearRules()
          removes all FilterRules from the Filter.
 boolean containsMatches(FilterMatches m)
          checks, whether the Filter contains the given FilterMatches.
 boolean containsRule(FilterRule r)
          checks, whether the Filter contains the given FilterRule.
 org.jdom.Element deserializeToJDOM()
          returns a JDOM representation of the Filter.
 java.util.List<FilterMatches> getMatches()
          returns the FilterMatchess of the Filter.
 java.util.List<FilterRule> getRules()
          returns the FilterRules of the Filter.
 boolean isMatchesEmpty()
          returns whether the Filter contains FilterMatchess.
 boolean isReferenceDurationFilter()
          Returns the referenceDurationFilter of the Filter which indicates whether content filtering is enabled for reference dates as well.
 boolean isRequireSitemapNode()
          returns whether a visible SitemapNode is required for a match to be displayed.
 boolean isRulesEmpty()
          returns whether the Filter contains FilterRule s.
 int matchesSize()
          returns the number of FilterMatchess in the Filter.
 boolean removeMatches(FilterMatches m)
          removes the given FilterMatches from the Filter .
 FilterMatches removeMatches(int index)
          removes the FilterMatches at the given index.
 boolean removeRule(FilterRule r)
          removes the given FilterRule from the Filter.
 FilterRule removeRule(int index)
          removes the FilterRule at the given index.
 int rulesSize()
          returns the number of FilterRules in the Filter .
 FilterMatches setMatches(int index, FilterMatches element)
          sets the given FilterMatches at the given index.
 void setReferenceDurationFilter(boolean isReferenceDurationFilter)
          Sets the referenceDurationFilter for the Filter.
 void setRequireSitemapNode(boolean rsm)
          sets whether a visible SitemapNode is required for a match to be displayed.
 FilterRule setRule(int index, FilterRule element)
          sets the given FilterRule at the given index.
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractNamableEntity
setName
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractNamedEntity
getName
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractBasicEntity
compareTo, equals, getFullQualifiedClassNameJAXB, getId, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.torweg.pulse.util.INameable
setName
 
Methods inherited from interface org.torweg.pulse.util.INamed
getName
 

Constructor Detail

Filter

@Deprecated
protected Filter()
Deprecated. 

used by HibernateTM.


Filter

public Filter(java.lang.String n)
creates a new ContentFilter with the given name.

Parameters:
n - the name
Method Detail

setRequireSitemapNode

public final void setRequireSitemapNode(boolean rsm)
sets whether a visible SitemapNode is required for a match to be displayed.

Parameters:
rsm - true, if a visible sitemap node is required

isRequireSitemapNode

public final boolean isRequireSitemapNode()
returns whether a visible SitemapNode is required for a match to be displayed.

Returns:
true, if and only if a visible sitemap node is required. Otherwise false.

getMatches

public final java.util.List<FilterMatches> getMatches()
returns the FilterMatchess of the Filter.

Returns:
the matches

addMatches

public final boolean addMatches(FilterMatches m)
adds a FilterMatches to the Filter.

Parameters:
m - the matches to add
Returns:
true, if the matches has been added
See Also:
Set.add(java.lang.Object)

addMatches

public final void addMatches(int index, FilterMatches element)
adds a new FilterMatches at the given index.

Parameters:
index - the index
element - the matches to add
See Also:
List.add(int, java.lang.Object)

setMatches

public final FilterMatches setMatches(int index, FilterMatches element)
sets the given FilterMatches at the given index.

Parameters:
index - the index
element - the matches to be set
Returns:
the rule which has previously been at the index position
See Also:
List.set(int, java.lang.Object)

clearMatches

public final void clearMatches()
removes all FilterMatches from the Filter.

See Also:
Set.clear()

containsMatches

public final boolean containsMatches(FilterMatches m)
checks, whether the Filter contains the given FilterMatches.

Parameters:
m - the matches to look for
Returns:
true, if the Filter contains the given FilterMatches
See Also:
Set.contains(java.lang.Object)

isMatchesEmpty

public final boolean isMatchesEmpty()
returns whether the Filter contains FilterMatchess.

Returns:
true, if the Filter does not contain any FilterMatchess
See Also:
Set.isEmpty()

removeMatches

public final boolean removeMatches(FilterMatches m)
removes the given FilterMatches from the Filter .

Parameters:
m - the matches to remove
Returns:
true, if the FilterMatches has been removed
See Also:
Set.remove(java.lang.Object)

removeMatches

public final FilterMatches removeMatches(int index)
removes the FilterMatches at the given index.

Parameters:
index - the index
Returns:
the removed rule
See Also:
List.remove(int)

matchesSize

public final int matchesSize()
returns the number of FilterMatchess in the Filter.

Returns:
the number of FilterMatchess in the Filter
See Also:
Set.size()

getRules

public final java.util.List<FilterRule> getRules()
returns the FilterRules of the Filter.

Returns:
the rules

addRule

public final boolean addRule(FilterRule r)
adds a FilterRule to the Filter.

Parameters:
r - the rule to add
Returns:
true, if the rule has been added
See Also:
Set.add(java.lang.Object)

addRule

public final void addRule(int index, FilterRule element)
adds a new FilterRule at the given index.

Parameters:
index - the index
element - the rule to add
See Also:
List.add(int, java.lang.Object)

setRule

public final FilterRule setRule(int index, FilterRule element)
sets the given FilterRule at the given index.

Parameters:
index - the index
element - the rule to be set
Returns:
the rule which has previously been at the index position
See Also:
List.set(int, java.lang.Object)

clearRules

public final void clearRules()
removes all FilterRules from the Filter.

See Also:
Set.clear()

containsRule

public final boolean containsRule(FilterRule r)
checks, whether the Filter contains the given FilterRule.

Parameters:
r - the rule to look for
Returns:
true, if the Filter contains the given FilterRule
See Also:
Set.contains(java.lang.Object)

isRulesEmpty

public final boolean isRulesEmpty()
returns whether the Filter contains FilterRule s.

Returns:
true, if the Filter does not contain any FilterRules
See Also:
Set.isEmpty()

removeRule

public final boolean removeRule(FilterRule r)
removes the given FilterRule from the Filter.

Parameters:
r - the rule to remove
Returns:
true, if the FilterRule has been removed
See Also:
Set.remove(java.lang.Object)

removeRule

public final FilterRule removeRule(int index)
removes the FilterRule at the given index.

Parameters:
index - the index
Returns:
the removed rule
See Also:
List.remove(int)

rulesSize

public final int rulesSize()
returns the number of FilterRules in the Filter .

Returns:
the number of FilterRules in the Filter
See Also:
Set.size()

isReferenceDurationFilter

public final boolean isReferenceDurationFilter()
Returns the referenceDurationFilter of the Filter which indicates whether content filtering is enabled for reference dates as well.

Returns:
the referenceDurationFilter

setReferenceDurationFilter

public final void setReferenceDurationFilter(boolean isReferenceDurationFilter)
Sets the referenceDurationFilter for the Filter.

Parameters:
isReferenceDurationFilter - the referenceDurationFilter to set

deserializeToJDOM

public org.jdom.Element deserializeToJDOM()
returns a JDOM representation of the Filter.

Specified by:
deserializeToJDOM in interface JDOMable
Returns:
a JDOM representation of the Filter