com.tonbeller.jpivot.table.span
Class ScopedPropertyMetaSet

java.lang.Object
  extended by com.tonbeller.jpivot.table.span.ScopedPropertyMetaSet

public class ScopedPropertyMetaSet
extends java.lang.Object

A MemberPropertyMeta Set implementation that supports different scopes (Level and Hierarchy). An Entry is identified by the Scope (either Level or Hierarchy) of the PropertyMeta and the property name. Example: Property "a" belongs to Level "l1" of Hierarchy "h", another Property "a" (same name) to Level "l2" (different Level) of the same Hierarchy "h". If these properties are added to a Level-scoped set, it would contain 2 different entries. When added to a Hierarchy-scoped set, it would contain one entry only (the first one added).

Author:
av

Constructor Summary
ScopedPropertyMetaSet(MemberProperties extension)
           
 
Method Summary
 void add(MemberPropertyMeta mpm)
           
 void addAll(java.util.Collection memberPropertyMetas)
           
 void addMember(Member member)
          for every property of member, creates a MemberPropertyMeta and adds it to this set
 boolean contains(MemberPropertyMeta mpm)
          true, if mpm is contained in the visiblePropertiyMetas collection
 boolean contains(java.lang.String scope, java.lang.String name)
          true if the property name is contained in the scope.
 com.tonbeller.jpivot.table.span.MemberPropertyMetaFilter createAllFilter()
           
 com.tonbeller.jpivot.table.span.MemberPropertyMetaFilter createIgnoreInlineFilter()
           
 com.tonbeller.jpivot.table.span.MemberPropertyMetaFilter createScopesFilter(java.util.Set scopes)
           
 java.util.List intersectList(java.util.List metas)
          creates a new List that contains all the MemberPropertyMetas that are contained in metas and are contained in this set (intersection).
 java.util.List metaList(com.tonbeller.jpivot.table.span.MemberPropertyMetaFilter filter)
          returns a list of Metas that pass the filter
 ScopedPropertyMetaSet metaSet(com.tonbeller.jpivot.table.span.MemberPropertyMetaFilter filter)
          returns a subset containing the metas that pass the filter
 void remove(MemberPropertyMeta mpm)
           
 void removeAll(java.util.Collection memberPropertyMetas)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScopedPropertyMetaSet

public ScopedPropertyMetaSet(MemberProperties extension)
Method Detail

addAll

public void addAll(java.util.Collection memberPropertyMetas)

removeAll

public void removeAll(java.util.Collection memberPropertyMetas)

addMember

public void addMember(Member member)
for every property of member, creates a MemberPropertyMeta and adds it to this set

Parameters:
member -

add

public void add(MemberPropertyMeta mpm)

remove

public void remove(MemberPropertyMeta mpm)

contains

public boolean contains(MemberPropertyMeta mpm)
true, if mpm is contained in the visiblePropertiyMetas collection

Parameters:
mpm -
Returns:

contains

public boolean contains(java.lang.String scope,
                        java.lang.String name)
true if the property name is contained in the scope. Example usage:
   Member m = ...
   Property p = m.getProperty("foo");
   MemberProperties extension = (MemberProperties ) model.getExtension(MemberProperties.ID);
   
   if (set.contains(extension.getScope(m), p.getName())
     ...
 

Parameters:
scope -
name -
Returns:

intersectList

public java.util.List intersectList(java.util.List metas)
creates a new List that contains all the MemberPropertyMetas that are contained in metas and are contained in this set (intersection). The order is not changed.

Parameters:
metas - a list of MemberPropertyMetas
Returns:

metaList

public java.util.List metaList(com.tonbeller.jpivot.table.span.MemberPropertyMetaFilter filter)
returns a list of Metas that pass the filter


metaSet

public ScopedPropertyMetaSet metaSet(com.tonbeller.jpivot.table.span.MemberPropertyMetaFilter filter)
returns a subset containing the metas that pass the filter


createAllFilter

public com.tonbeller.jpivot.table.span.MemberPropertyMetaFilter createAllFilter()

createScopesFilter

public com.tonbeller.jpivot.table.span.MemberPropertyMetaFilter createScopesFilter(java.util.Set scopes)

createIgnoreInlineFilter

public com.tonbeller.jpivot.table.span.MemberPropertyMetaFilter createIgnoreInlineFilter()