|
|
|
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.torweg.pulse.util.entity.AbstractBasicEntity
org.torweg.pulse.site.content.ContentLocalizationMap
@Entity public class ContentLocalizationMap
marks a set of Contents to be localizations of each other.
Within a ContentLocalizationMap each Locale and Content may only appear once. Moreover all Contents have to be of
the exact same type.
The put(Locale, Content) method does not comply with the general
Map contract, as it does not support the overwriting of
values!
| Constructor Summary | |
|---|---|
protected |
ContentLocalizationMap()
Deprecated. |
|
ContentLocalizationMap(java.util.Locale l, Content c)
creates a new ContentLocalizationMap for the given Content and the given Locale. |
| Method Summary | |
|---|---|
void |
clear()
removes all mappings from this map. |
boolean |
containsKey(java.lang.Object key)
returns true if this map contains a mapping for the specified key. |
boolean |
containsValue(java.lang.Object value)
returns true if this map maps one or more keys to the specified value. |
org.jdom.Element |
deserializeToJDOM()
Always throws PulseException. |
java.util.Set<java.util.Map.Entry<java.util.Locale,Content>> |
entrySet()
returns a set view of the mappings contained in this map. |
Content |
get(java.lang.Object key)
returns the value to which this map maps the specified key. |
boolean |
isEmpty()
returns true if this map contains no key-value mappings. |
java.util.Set<java.util.Locale> |
keySet()
returns a set view of the keys contained in this map. |
Content |
put(java.util.Locale key, Content value)
puts a new mapping from key to value provided
both the key and value are not yet part of the
ContentLocalizationMap and the Content is of the same
type as the other values already present in the map. |
void |
putAll(java.util.Map<? extends java.util.Locale,? extends Content> t)
copies all of the mappings from the specified map to this map. |
Content |
remove(java.lang.Object key)
removes the mapping for this key from this map if it is present. |
int |
size()
returns the number of key-value mappings in this map. |
java.util.Collection<Content> |
values()
returns a collection view of the values contained in this map. |
| 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 |
| Constructor Detail |
|---|
@Deprecated protected ContentLocalizationMap()
public ContentLocalizationMap(java.util.Locale l, Content c)
ContentLocalizationMap for the given Content and the given Locale.
l - the localec - the content| Method Detail |
|---|
public final void clear()
public final boolean containsKey(java.lang.Object key)
throws java.lang.ClassCastException,
java.lang.NullPointerException
key - key whose presence in this map is to be tested.
java.lang.ClassCastException - if the key is of an inappropriate type for this map.
java.lang.NullPointerException - if the key is null.
public final boolean containsValue(java.lang.Object value)
throws java.lang.ClassCastException,
java.lang.NullPointerException
value - value whose presence in this map is to be tested.
java.lang.ClassCastException - if the value is of an inappropriate type for this map.
java.lang.NullPointerException - if the value is null and this map does not permit
null values.public final java.util.Set<java.util.Map.Entry<java.util.Locale,Content>> entrySet()
Map.Entry. The set is backed by the map, so
changes to the map are reflected in the set, and vice-versa. If the map
is modified while an iteration over the set is in progress (except
through the iterator's own remove operation, or through the
setValue operation on a map entry returned by the iterator) the
results of the iteration are undefined. The set supports element removal,
which removes the corresponding mapping from the map, via the
Iterator.remove, Set.remove, removeAll,
retainAll and clear operations. It does not support the
add or addAll operations.
public final Content get(java.lang.Object key)
throws java.lang.ClassCastException,
java.lang.NullPointerException
More formally, if this map contains a mapping from a key k to a value v such that (key==null ? k==null : key.equals(k)), then this method returns v; otherwise it returns null. (There can be at most one such mapping.)
key - key whose associated value is to be returned.
java.lang.ClassCastException - if the key is of an inappropriate type for this map.
java.lang.NullPointerException - if the key is null.containsKey(Object)public final boolean isEmpty()
public final java.util.Set<java.util.Locale> keySet()
public final Content put(java.util.Locale key, Content value)
throws InconsistentLocalizationException
key to value provided
both the key and value are not yet part of the
ContentLocalizationMap and the Content is of the same
type as the other values already present in the map.
key - the localevalue - the content
null (to match the Map interface)
InconsistentLocalizationException - when a precondition for putting the association failspublic final void putAll(java.util.Map<? extends java.util.Locale,? extends Content> t)
put(Locale, Content) on this map once for
each mapping from key k to value v in the specified
map. The behaviour of this operation is unspecified if the specified map
is modified while the operation is in progress.
t - Mappings to be stored in this map.
public final Content remove(java.lang.Object key)
throws java.lang.ClassCastException,
java.lang.NullPointerException
(key==null ? k==null : key.equals(k)), that
mapping is removed. (The map can contain at most one such mapping.)
Returns the value to which the map previously associated the key, or null if the map contained no mapping for this key. (A null return can also indicate that the map previously associated null with the specified key if the implementation supports null values.) The map will not contain a mapping for the specified key once the call returns.
key - key whose mapping is to be removed from the map.
java.lang.ClassCastException - if the key is of an inappropriate type for this map.
java.lang.NullPointerException - if the key is null.public final int size()
public final java.util.Collection<Content> values()
public final org.jdom.Element deserializeToJDOM()
PulseException.
ONLY here to satisfy: ContentLocalizationMap
extends AbstractBasicEntity.
deserializeToJDOM in interface JDOMablePulseException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||