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 FilterMatches

java.lang.Object
  extended by org.torweg.pulse.site.content.filter.FilterMatches

@Entity
public class FilterMatches
extends java.lang.Object

describes the n:m relationship of the filtered ContentLocalizationMap and all its matching FilterRuleProperty objects.

Version:
$Revision: 1503 $
Author:
Thomas Weber, Daniel Dietz

Constructor Summary
protected FilterMatches()
          Deprecated. 
  FilterMatches(ContentLocalizationMap c)
          creates a new FilterMatches for the given object.
 
Method Summary
 boolean addProperty(FilterRuleProperty p)
          adds a FilterRuleProperty to the object's list of matching properties.
 void clearProperties()
          clears all properties of the filtered object.
 int compareTo(FilterMatches m)
          returns the result of the comparison.
 boolean containsProperty(FilterRuleProperty p)
          checks whether the FilterMatches contains the given property.
 boolean equals(java.lang.Object o)
          returns whether the given Object is equal to the FilterRule.
 ContentLocalizationMap getContentLocalizationMap()
           
 Filter getFilter()
          returns the Filter associated with the matches.
 ContentLocalizationMap getFilteredContent()
          returns the object, which is filterable with this FilterMatches.
 java.lang.Long getId()
          returns the primary key.
 java.util.Set<FilterRuleProperty> getProperties()
          returns the FilterRulePropertys.
 int hashCode()
          returns the int value of the id or super.hashCode(), if the id is still null.
 boolean isPropertiesEmpty()
          returns true, if the match contains no properties.
 int propertiesSize()
          returns the number of properties associated with the matches.
 boolean removeProperty(FilterRuleProperty p)
          removes a given FilterRuleProperty from the matches properties.
 void setFilter(Filter f)
          sets the Filter the match belongs to.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterMatches

@Deprecated
protected FilterMatches()
Deprecated. 

used by HibernateTM.


FilterMatches

public FilterMatches(ContentLocalizationMap c)
creates a new FilterMatches for the given object.

Parameters:
c - the content to be filterable
Method Detail

getId

public final java.lang.Long getId()
returns the primary key.

Returns:
the primary key.

getFilter

public final Filter getFilter()
returns the Filter associated with the matches.

Returns:
the filter.

setFilter

public final void setFilter(Filter f)
sets the Filter the match belongs to.

Parameters:
f - the filter to set

getFilteredContent

public final ContentLocalizationMap getFilteredContent()
returns the object, which is filterable with this FilterMatches.

Returns:
the filtered Object.

addProperty

public final boolean addProperty(FilterRuleProperty p)
adds a FilterRuleProperty to the object's list of matching properties.

Parameters:
p - the property to add
Returns:
true, if the property has been added. Otherwise false.
See Also:
Set.add(java.lang.Object)

clearProperties

public final void clearProperties()
clears all properties of the filtered object.

See Also:
Set.clear()

containsProperty

public final boolean containsProperty(FilterRuleProperty p)
checks whether the FilterMatches contains the given property.

Parameters:
p - the property to look for
Returns:
true, if the match contains the property. Otherwise false.
See Also:
Set.contains(java.lang.Object)

isPropertiesEmpty

public final boolean isPropertiesEmpty()
returns true, if the match contains no properties.

Returns:
true, if the match contains no properties. Otherwise false
See Also:
Set.isEmpty()

removeProperty

public final boolean removeProperty(FilterRuleProperty p)
removes a given FilterRuleProperty from the matches properties.

Parameters:
p - the property to remove
Returns:
true, if the property has been removed. Otherwise false.
See Also:
Set.remove(java.lang.Object)

propertiesSize

public final int propertiesSize()
returns the number of properties associated with the matches.

Returns:
the number of properties associated with the matches
See Also:
Set.size()

hashCode

public final int hashCode()
returns the int value of the id or super.hashCode(), if the id is still null.

Overrides:
hashCode in class java.lang.Object
Returns:
the int value of the id or super.hashCode(), if the id is still null
See Also:
Object.hashCode()

equals

public final boolean equals(java.lang.Object o)
returns whether the given Object is equal to the FilterRule.

Overrides:
equals in class java.lang.Object
Parameters:
o - the object to compare with
Returns:
true, if the given object is a FilterRule and the result of compareTo(FilterMatches) is 0

compareTo

public final int compareTo(FilterMatches m)
returns the result of the comparison.

If both rules have been persisted, the rule's ids are compared. Otherwise the hash codes are compared.

Parameters:
m - the matches to compare to
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
See Also:
Comparable.compareTo(Object)

getProperties

public final java.util.Set<FilterRuleProperty> getProperties()
returns the FilterRulePropertys.

Returns:
the FilterRulePropertys

getContentLocalizationMap

public final ContentLocalizationMap getContentLocalizationMap()
Returns:
the contentMap