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 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks that this object isn't frozen.boolean
Returns true if the given object is a member of this set.void
freeze()
Makes the object unmodifiable.Gets the map internally used for storing the membership statuses.boolean
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 Details
-
CmsDefaultSet
public CmsDefaultSet()
-
-
Method Details
-
checkNotFrozen
Checks that this object isn't frozen. -
contains
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
Makes the object unmodifiable. -
getBaseMap
Gets the map internally used for storing the membership statuses.- Returns:
- the membership map
-
getDefaultMembership
Gets the default membership value.- Returns:
- the default membership value
-
setContains
Sets the membership of an object.- Parameters:
value
- the objectisMember
- true if the object should be a member, otherwise false
-
setDefaultMembership
Sets the default membership value.- Parameters:
defaultMembership
- the new value
-