public class DocumentProperties extends Object implements Map<String,Object>, Externalizable
Map
optimized for usage with SpaceDocument
.
DocumentProperties
contains the following enhancements:
1. Usability: Fluent-styled setProperty method to enable fluent coding.
2. Serialization performance: Externalizable
implementation with special optimization for properties names.
3. Memory footprint: Open-addressing algorithm is used to conserve memory usage.SpaceDocument
,
Serialized FormConstructor and Description |
---|
DocumentProperties()
Constructs a new DocumentProperties.
|
DocumentProperties(int initialCapacity)
Constructs a new DocumentProperties with the specified initial capacity.
|
DocumentProperties(int initialCapacity,
float loadFactor)
Constructs a new DocumentProperties with the specified initial capacity and load factor.
|
DocumentProperties(Map<String,Object> properties)
Constructs a new DocumentProperties with the same properties as the specified Map.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<String,Object>> |
entrySet() |
boolean |
equals(Object obj)
Compares the specified object with this map for equality.
|
Object |
get(Object key) |
<T> T |
getProperty(String name)
Get document property value by name
|
int |
hashCode()
Returns the hash code value for this map.
|
boolean |
isEmpty() |
Set<String> |
keySet() |
Object |
put(String key,
Object value) |
void |
putAll(Map<? extends String,? extends Object> t) |
void |
readExternal(ObjectInput in) |
Object |
remove(Object key) |
DocumentProperties |
setProperty(String name,
Object value)
Set document property
|
int |
size() |
String |
toString() |
Collection<Object> |
values() |
void |
writeExternal(ObjectOutput out) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public DocumentProperties()
public DocumentProperties(int initialCapacity)
initialCapacity
- The initial capacity.public DocumentProperties(int initialCapacity, float loadFactor)
initialCapacity
- The initial capacity.loadFactor
- The load factor.public <T> T getProperty(String name)
name
- property namepublic DocumentProperties setProperty(String name, Object value)
name
- property namevalue
- property valuepublic boolean containsKey(Object key)
containsKey
in interface Map<String,Object>
public boolean containsValue(Object value)
containsValue
in interface Map<String,Object>
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public boolean equals(Object obj)
public int hashCode()
hashCode
in interface Map<String,Object>
hashCode
in class Object
Object.hashCode()
,
Object.equals(Object)
,
equals(Object)
Copyright © GigaSpaces.