Interface JSMap<K,E extends JSValue>
-
- All Superinterfaces:
JSValue
- All Known Subinterfaces:
JSAlerts,JSIdMap<K,E>,JSLinks,JSLocations,JSParticipants,JSRecurrenceOverrides,JSRelations,JSReplyTo,JSSendTo
- All Known Implementing Classes:
JSAlertsImpl,JSIdMapImpl,JSLinksImpl,JSLocationsImpl,JSMapImpl,JSParticipantsImpl,JSRecurrenceOverridesImpl,JSRelationsImpl,JSReplyToImpl,JSSendToImpl
public interface JSMap<K,E extends JSValue> extends JSValue
Have type K[E] where K is the key type, E is the element type. Each entry is represented as a JSProperty with the name being the key. All elements may be fetched as their values or as properties.Fetching as properties associates the key with a value. User: mike Date: 10/25/19 Time: 12:46
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<JSProperty<E>>get()JSProperty<E>get(K key)List<K>getKeys()JSProperty<E>makeEntry(K key)Create and add a new empty entryJSProperty<E>put(K key, E val)voidput(JSProperty<E> entry)voidremove(K key)voidremove(JSProperty<E> entry)intsize()Returns the number of entries in this map.-
Methods inherited from interface org.bedework.jsforj.model.values.JSValue
clear, copy, getBooleanProperty, getBooleanValue, getChanged, getNode, getObjectType, getOverrideGenerated, getOwner, getParentProperty, getProperties, getProperty, getProperty, getPropertyValue, getStringProperty, getStringValue, getType, getUnsignedIntegerProperty, getValue, hasChanges, hasProperty, isString, makeProperty, markOverrideGenerated, newProperty, preWrite, removeProperty, setProperty, setProperty, setProperty, setProperty, setProperty, writeValue, writeValueAsString, writeValueAsStringFormatted
-
-
-
-
Method Detail
-
size
int size()
Returns the number of entries in this map. If this list contains more thanInteger.MAX_VALUEelements, returnsInteger.MAX_VALUE.- Returns:
- the number of entries in this map
-
get
List<JSProperty<E>> get()
- Returns:
- all the entries as properties or empty list
-
get
JSProperty<E> get(K key)
- Parameters:
key- for entry- Returns:
- the property or null
-
put
JSProperty<E> put(K key, E val)
- Parameters:
key- for value to be added to mapval- to be added to map- Returns:
- the new property
-
put
void put(JSProperty<E> entry)
- Parameters:
entry- to be added to map
-
remove
void remove(K key)
- Parameters:
key- to remove
-
remove
void remove(JSProperty<E> entry)
- Parameters:
entry- to remove
-
makeEntry
JSProperty<E> makeEntry(K key)
Create and add a new empty entry- Parameters:
key- - the entry key
-
-