Package org.cip4.jdflib.datatypes
Class VJDFAttributeMap
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<JDFAttributeMap>,Collection<JDFAttributeMap>,List<JDFAttributeMap>,RandomAccess
Description: This class represents a vector of JDFAttributeMaps
- See Also:
-
Field Summary
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementDataFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionconstructorcopy constructor, the map elements are clonedVJDFAttributeMap(Vector<JDFAttributeMap> toAdd) copy constructor, the map elements are clonedVJDFAttributeMap(JDFAttributeMap moreMap) VJDFAttributeMap(JDFAttributeMap[] toAdd) constructor from array, the map elements are not cloned -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.use addAllvoidvoidMethod appendUnique.voidvoidappendUnique(VJDFAttributeMap maps) Method appendUnique.clone()booleancontainsKey(Object key) elementAt(int i) Returns the element at the given positionbooleanequals - Compares two map vectors, returns true if content equal regardless of element order, otherwise false.
If input is not of type VJDFAttributeMap, result of superclasses equals method is returned.voidreplace all maps in this with n maps that have the values strKey, vsValuesget(int i) Returns the element at the given position (may be<0 to count backwards)andMap - builds a new vector of maps with identical pairs of both maps does not modify thisreturn the map that is common to all elements of this.getKeys()return list of all keysgetMatchingMaps(String key, String regExp, boolean ignoreCase) Method overlapMap.static VJDFAttributeMapgetOrMaps(Collection<JDFAttributeMap> vMap) andMap - builds a new vector of maps with identical pairs of both maps does not modify thisgetOrMaps(JDFAttributeMap map) andMap - builds a new vector of maps with identical pairs of both maps does not modify thisgetOrMaps(VJDFAttributeMap vMap) Method overlapMap.getPartValues(String strKey, boolean bUnique) Deprecated.- use thisstatic VJDFAttributeMapgetVector(JDFAttributeMap partMap) booleanDeprecated.use containsinthashCode()hashCode complements equals() to fulfill the equals/hashCode contractstatic booleanstatic booleanare we null or empty or contain only an empty JDFAttributeMapintmaxSize()Return the maximum size size of a JDFAttributeMap in thisintminSize()Return the minimum size size of a JDFAttributeMap in thisvoidoverlapMap(Collection<JDFAttributeMap> vMap) voidMethod overlapMap.voidoverlapMap(VJDFAttributeMap vMap) Method overlapMap.booleanoverlapsMap(Collection<JDFAttributeMap> vMap) Method overlapsMap.booleanMethod overlapMap.booleanoverlapsMap(VJDFAttributeMap vMap) voidput the key value pair into all entriesvoidput the key value pair into all entries; if no entries are there, create exactly one entry with the given key value pairvoidput(JDFAttributeMap commonMap) put the value of all keys into every existing mapvoidDeprecated.use reduceMapvoidreduceMap(Collection<String> keySet) reduce each JDFAttributeMap inthisby keySet (only entries in keyset are retained)voidremoveElementAt(int i) voidremove the key specified and then erase any duplicates and emptysvoidremoveKeys(Collection<String> set) remove the keys specified in set and then erase any duplicates and emptysvoidremove all matching maps from this i.e.voidsetElementAt(JDFAttributeMap mTmp, int j) voidsets the Vector with JDFAttributeMap elementsbooleansubMap(Collection<JDFAttributeMap> vMap) Method subMap.booleansubMap(JDFAttributeMap map) Method subMap.booleansubMap(VJDFAttributeMap vMap) toString()toStringvoidunify()unify - make VElement unique, retaining initial orderMethods inherited from class java.util.Vector
add, add, addAll, addAll, capacity, clear, contains, containsAll, copyInto, elements, ensureCapacity, firstElement, forEach, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeIf, removeRange, replaceAll, retainAll, set, setSize, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Constructor Details
-
VJDFAttributeMap
public VJDFAttributeMap()constructor -
VJDFAttributeMap
copy constructor, the map elements are cloned- Parameters:
toAdd- Vector of elements to clone
-
VJDFAttributeMap
copy constructor, the map elements are cloned- Parameters:
toAdd- Vector of elements to clone
-
VJDFAttributeMap
constructor from array, the map elements are not cloned- Parameters:
toAdd- the array
-
VJDFAttributeMap
- Parameters:
moreMap- the single attribute map to add
-
-
Method Details
-
toString
toString- Overrides:
toStringin classVector<JDFAttributeMap>- Returns:
- String
-
getNonEmpty
- Parameters:
v-- Returns:
-
getVector
- Parameters:
partMap-- Returns:
-
isEmpty
are we null or empty or contain only an empty JDFAttributeMap- Parameters:
v-- Returns:
-
isEmpty
-
showKeys
- Parameters:
sepMap- the separator between mapssepEntry- the separator between map entries- Returns:
- the string representation
-
getPartValues
- Parameters:
strKey- the attribute to get values frombUnique- if true, ensure unique vector, else the vector corresponds to the vector of values- Returns:
- the Vector of all values
-
extendMap
replace all maps in this with n maps that have the values strKey, vsValues- Parameters:
strKey- the new key to addvsValues- String of values
-
getAndMaps
andMap - builds a new vector of maps with identical pairs of both maps does not modify this- Parameters:
map- the given map- Returns:
- the anded map, null if mismatches occurred
-
getOrMaps
andMap - builds a new vector of maps with identical pairs of both maps does not modify this- Parameters:
map- the given map- Returns:
- the anded map, null if mismatches occurred
-
getOrMaps
-
getOrMaps
andMap - builds a new vector of maps with identical pairs of both maps does not modify this- Parameters:
map- the given map- Returns:
- the anded map, null if mismatches occurred
-
containsKey
- Parameters:
key- the key to check for- Returns:
- true if any of the maps contains key
- See Also:
-
setVector
sets the Vector with JDFAttributeMap elements- Parameters:
vec- the Vector with JDFAttributeMap elements
-
maxSize
public int maxSize()Return the maximum size size of a JDFAttributeMap in this- Returns:
- int - the size
-
minSize
public int minSize()Return the minimum size size of a JDFAttributeMap in this- Returns:
- int - the size
-
elementAt
Returns the element at the given position- Overrides:
elementAtin classVector<JDFAttributeMap>- Parameters:
i- the given position (may be<0 to count backwards)- Returns:
- JDFAttributeMap - the selected element
-
get
Returns the element at the given position (may be<0 to count backwards)- Specified by:
getin interfaceList<JDFAttributeMap>- Overrides:
getin classVector<JDFAttributeMap>- Parameters:
i- the given position- Returns:
- JDFAttributeMap - the selected element
-
removeKeys
remove the keys specified in set and then erase any duplicates and emptys- Parameters:
set-
-
removeElementAt
public void removeElementAt(int i) - Overrides:
removeElementAtin classVector<JDFAttributeMap>
-
removeKey
remove the key specified and then erase any duplicates and emptys- Parameters:
key-
-
hasEntryWithEqualKeyValuePairs
Deprecated.use containsTests whether this has a entry with the same key and value entries not more nor less keys- Parameters:
attmap- the given JDFAttributeMap element- Returns:
- boolean - true if and only if the specified AttributeMap has the some number of keys and values and the same keys and values as a entry in this vector
-
reduceKey
Deprecated.use reduceMap- Parameters:
vKeys-
-
reduceMap
reduce each JDFAttributeMap inthisby keySet (only entries in keyset are retained)- Parameters:
keySet-
-
getKeys
return list of all keys- Returns:
- the vector of all keys
-
getVector
Deprecated.- use thisReturns the vector with JDFAttributeMap elements- Returns:
- Vector - the vector with JDFAttributeMap elements
-
getCommonMap
return the map that is common to all elements of this. All keys exist and have the same value- Returns:
- the vector of all keys
-
appendUnique
- Parameters:
map- map to append
-
addElement
- Overrides:
addElementin classVector<JDFAttributeMap>
-
unify
public void unify()unify - make VElement unique, retaining initial order -
appendUnique
Method appendUnique.- Parameters:
maps- maps to append
-
appendUnique
Method appendUnique.- Parameters:
maps- maps to append
-
addall
Deprecated.use addAlldeprecated legacy support- Parameters:
v-
-
overlapMap
Method overlapMap. removes all non-overlapping maps from this- Parameters:
map- the map to check against
-
getOverlapMaps
Method overlapMap. get a copy of this with all overlapping maps the maps are NOT cloned- Parameters:
map- the map to check against- Returns:
- a new VJDFAttributemap with the overlapping entries of this - never null
-
getMatchingMaps
Method overlapMap. get a copy of this with all matching maps the maps are NOT cloned- Parameters:
key- the key to matchregExp- the simplified regexpignoreCase- duh...- Returns:
- a new VJDFAttributemap with the matching entries of this - never null (may be safely daisy-chained)
-
overlapMap
Method overlapMap. only entries that contain at least one matching map entry are retained- Parameters:
vMap- the map to check against
-
overlapMap
-
overlapsMap
Method overlapMap.- Parameters:
map- the map to check against- Returns:
-
subMap
Method subMap.- Parameters:
map- the submap to check against- Returns:
- true if this has at least one entry that subMap is a submap of
-
subMap
-
subMap
Method subMap.- Parameters:
vMap- the vector submaps to check against- Returns:
- true if this has at least one entry that vMap contains at least a submap of
-
overlapsMap
-
overlapsMap
Method overlapsMap. returns true if at least one element exists that has no non-matching key value pairs- Parameters:
vMap- the vector to check against- Returns:
- true if this has at least one entry that vMap contains at least a submap of
-
equals
equals - Compares two map vectors, returns true if content equal regardless of element order, otherwise false.
If input is not of type VJDFAttributeMap, result of superclasses equals method is returned.- Specified by:
equalsin interfaceCollection<JDFAttributeMap>- Specified by:
equalsin interfaceList<JDFAttributeMap>- Overrides:
equalsin classVector<JDFAttributeMap>- Parameters:
other- in this case VJDFAttributeMap to compare- Returns:
- boolean - true if the maps are equal, otherwise false
-
hashCode
public int hashCode()hashCode complements equals() to fulfill the equals/hashCode contract- Specified by:
hashCodein interfaceCollection<JDFAttributeMap>- Specified by:
hashCodein interfaceList<JDFAttributeMap>- Overrides:
hashCodein classVector<JDFAttributeMap>- Returns:
- int
-
put
put the key value pair into all entries- Parameters:
key- the key to set - may be either String or Enumvalue- the value to set - may be either String or Enum- Throws:
IllegalArgumentException- if key or value have the wrong type
-
put
put the key value pair into all entries; if no entries are there, create exactly one entry with the given key value pair- Parameters:
key- the key to setvalue- the value to set
-
clone
- Overrides:
clonein classVector<JDFAttributeMap>- Returns:
- See Also:
-
removeMaps
remove all matching maps from this i.e. if map is subMap of this- Parameters:
map-
-
put
put the value of all keys into every existing map- Parameters:
commonMap-
-
setElementAt
- Overrides:
setElementAtin classVector<JDFAttributeMap>
-