Package org.opencms.util
Class CmsDefaultSet<T>
- java.lang.Object
-
- org.opencms.util.CmsDefaultSet<T>
-
- Type Parameters:
T
- the element type
- All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable
public class CmsDefaultSet<T> extends java.lang.Object implements com.google.gwt.user.client.rpc.IsSerializable
A utility class used for keeping track of a set of objects. You can explicitly include or exclude objects, and define a default membership value for those objects whose membership hasn't been explicitly set.
-
-
Constructor Summary
Constructors Constructor Description CmsDefaultSet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkNotFrozen()
Checks that this object isn't frozen.boolean
contains(T value)
Returns true if the given object is a member of this set.void
freeze()
Makes the object unmodifiable.java.util.Map<T,java.lang.Boolean>
getBaseMap()
Gets the map internally used for storing the membership statuses.boolean
getDefaultMembership()
Gets the default membership value.void
setContains(T value, boolean isMember)
Sets the membership of an object.void
setDefaultMembership(boolean defaultMembership)
Sets the default membership value.
-
-
-
Constructor Detail
-
CmsDefaultSet
public CmsDefaultSet()
-
-
Method Detail
-
checkNotFrozen
public void checkNotFrozen()
Checks that this object isn't frozen.
-
contains
public boolean contains(T value)
Returns true if the given object is a member of this set.- Parameters:
value
- the value to check- Returns:
- true if the value is a member
-
freeze
public void freeze()
Makes the object unmodifiable.
-
getBaseMap
public java.util.Map<T,java.lang.Boolean> getBaseMap()
Gets the map internally used for storing the membership statuses.- Returns:
- the membership map
-
getDefaultMembership
public boolean getDefaultMembership()
Gets the default membership value.- Returns:
- the default membership value
-
setContains
public void setContains(T value, boolean isMember)
Sets the membership of an object.- Parameters:
value
- the objectisMember
- true if the object should be a member, otherwise false
-
setDefaultMembership
public void setDefaultMembership(boolean defaultMembership)
Sets the default membership value.- Parameters:
defaultMembership
- the new value
-
-