org.cip4.jdflib.datatypes
Class VJDFAttributeMap

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector<JDFAttributeMap>
              extended by org.cip4.jdflib.datatypes.VJDFAttributeMap
All Implemented Interfaces:
Serializable, Cloneable, Iterable<JDFAttributeMap>, Collection<JDFAttributeMap>, List<JDFAttributeMap>, RandomAccess

public class VJDFAttributeMap
extends Vector<JDFAttributeMap>

Description: This class represents a vector of JDFAttributeMaps

Version:
1.0 2002-01-24
Author:
Torsten Kaehlert
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
VJDFAttributeMap()
          constructor
VJDFAttributeMap(JDFAttributeMap moreMap)
           
VJDFAttributeMap(JDFAttributeMap[] toAdd)
          constructor from array, the map elements are not cloned
VJDFAttributeMap(Vector<JDFAttributeMap> toAdd)
          copy constructor, the map elements are cloned
 
Method Summary
 void addall(VJDFAttributeMap v)
          Deprecated. use addAll
 void appendUnique(JDFAttributeMap map)
           
 void appendUnique(VJDFAttributeMap map)
          Method appendUnique.
 VJDFAttributeMap clone()
           
 boolean containsKey(Object key)
           
 JDFAttributeMap elementAt(int i)
          Returns the element at the given position
 boolean equals(Object other)
          equals - Compares two map vectors, returns true if content equal regardless of element order, otherwise false.
 void extendMap(String strKey, VString vsValues)
          replace all maps in this with n maps that have the values strKey, vsValues
 JDFAttributeMap get(int i)
          Returns the element at the given position (may be<0 to count backwards)
 VJDFAttributeMap getAndMaps(JDFAttributeMap map)
          andMap - builds a new vector of maps with identical pairs of both maps does not modify this
 VString getKeys()
          reduce each JDFAttributeMap in this by keySet
 VJDFAttributeMap getOrMaps(JDFAttributeMap map)
          andMap - builds a new vector of maps with identical pairs of both maps does not modify this
 VString getPartValues(String strKey, boolean bUnique)
           
 Vector<JDFAttributeMap> getVector()
          Deprecated. - use this
 boolean hasEntryWithEqualKeyValuePairs(JDFAttributeMap attmap)
          Deprecated. use contains
 int hashCode()
          hashCode complements equals() to fulfill the equals/hashCode contract
 int maxSize()
          Return the maximum size size of a JDFAttributeMap in this
 int minSize()
          Return the maximum size size of a JDFAttributeMap in this
 void overlapMap(JDFAttributeMap map)
          Method overlapMap.
 void overlapMap(VJDFAttributeMap map)
          Method overlapMap. only entries that contain at least one matching map entry are retained
 boolean overlapsMap(JDFAttributeMap map)
          Method overlapMap.
 boolean overlapsMap(VJDFAttributeMap vMap)
          Method overlapsMap. returns true if at least one element exists that has no non-matching key value pairs
 void put(Object key, Object value)
          put the key value pair into all entries
 void put(String key, String value)
          put the key value pair into all entries; if no entries are there, create exactly one entry with the given key value pair
 void reduceKey(Vector vKeys)
          Deprecated. use reduceMap
 void reduceMap(Collection<String> keySet)
          reduce each JDFAttributeMap in this by keySet
 void removeKeys(Collection<String> set)
          remove the keys specified in set and then erase any duplicates and emptys
 void removeMaps(JDFAttributeMap map)
          remove all matching maps from this i.e. if map is subMap of this
 void setVector(Vector<JDFAttributeMap> vec)
          sets the Vector with JDFAttributeMap elements
 String showKeys(String sepMap, String sepEntry)
           
 boolean subMap(JDFAttributeMap map)
          Method subMap.
 boolean subMap(VJDFAttributeMap vMap)
          Method subMap.
 String toString()
          toString
 void unify()
          unify - make VElement unique, retaining initial order
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, contains, containsAll, copyInto, elements, ensureCapacity, firstElement, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

VJDFAttributeMap

public VJDFAttributeMap()
constructor


VJDFAttributeMap

public VJDFAttributeMap(Vector<JDFAttributeMap> toAdd)
copy constructor, the map elements are cloned

Parameters:
toAdd - Vector of elements to clone

VJDFAttributeMap

public VJDFAttributeMap(JDFAttributeMap[] toAdd)
constructor from array, the map elements are not cloned

Parameters:
toAdd - the array

VJDFAttributeMap

public VJDFAttributeMap(JDFAttributeMap moreMap)
Parameters:
moreMap - the single attribute map to add
Method Detail

toString

public String toString()
toString

Overrides:
toString in class Vector<JDFAttributeMap>
Returns:
String

showKeys

public String showKeys(String sepMap,
                       String sepEntry)
Parameters:
sepMap - the separator between maps
sepEntry - the separator between map entries
Returns:
the string representation

getVector

@Deprecated
public Vector<JDFAttributeMap> getVector()
Deprecated. - use this

Returns the vector with JDFAttributeMap elements

Returns:
Vector - the vector with JDFAttributeMap elements

getPartValues

public VString getPartValues(String strKey,
                             boolean bUnique)
Parameters:
strKey - the attribute to get values from
bUnique - if true, ensure unique vector, else the vector coressponds to the voctor of maps
Returns:
the Vector of all values

extendMap

public void extendMap(String strKey,
                      VString vsValues)
replace all maps in this with n maps that have the values strKey, vsValues

Parameters:
strKey - the new key to add
vsValues - String of values

getAndMaps

public VJDFAttributeMap getAndMaps(JDFAttributeMap map)
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

public VJDFAttributeMap getOrMaps(JDFAttributeMap map)
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

public boolean containsKey(Object key)
Parameters:
key - the key to check for
Returns:
true if any of the maps contains key
See Also:
Map.containsKey(java.lang.Object)

setVector

public void setVector(Vector<JDFAttributeMap> vec)
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 maximum size size of a JDFAttributeMap in this

Returns:
int - the size

elementAt

public JDFAttributeMap elementAt(int i)
Returns the element at the given position

Overrides:
elementAt in class Vector<JDFAttributeMap>
Parameters:
i - the given position (may be<0 to count backwards)
Returns:
JDFAttributeMap - the selected element

get

public JDFAttributeMap get(int i)
Returns the element at the given position (may be<0 to count backwards)

Specified by:
get in interface List<JDFAttributeMap>
Overrides:
get in class Vector<JDFAttributeMap>
Parameters:
i - the given position
Returns:
JDFAttributeMap - the selected element

removeKeys

public void removeKeys(Collection<String> set)
remove the keys specified in set and then erase any duplicates and emptys

Parameters:
set -

hasEntryWithEqualKeyValuePairs

@Deprecated
public boolean hasEntryWithEqualKeyValuePairs(JDFAttributeMap attmap)
Deprecated. use contains

Tests 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
public void reduceKey(Vector vKeys)
Deprecated. use reduceMap

Parameters:
vKeys -

reduceMap

public void reduceMap(Collection<String> keySet)
reduce each JDFAttributeMap in this by keySet

Parameters:
keySet -

getKeys

public VString getKeys()
reduce each JDFAttributeMap in this by keySet

Returns:
the vector of all keys

appendUnique

public void appendUnique(JDFAttributeMap map)
Parameters:
map - map to append

unify

public void unify()
unify - make VElement unique, retaining initial order


appendUnique

public void appendUnique(VJDFAttributeMap map)
Method appendUnique.

Parameters:
map - maps to append

addall

@Deprecated
public void addall(VJDFAttributeMap v)
Deprecated. use addAll

deprecated legacy support

Parameters:
v -

overlapMap

public void overlapMap(JDFAttributeMap map)
Method overlapMap.

Parameters:
map - the map to check against

overlapMap

public void overlapMap(VJDFAttributeMap map)
Method overlapMap. only entries that contain at least one matching map entry are retained

Parameters:
map - the map to check against

overlapsMap

public boolean overlapsMap(JDFAttributeMap map)
Method overlapMap.

Parameters:
map - the map to check against
Returns:

subMap

public boolean subMap(JDFAttributeMap map)
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

public boolean subMap(VJDFAttributeMap vMap)
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

public boolean overlapsMap(VJDFAttributeMap vMap)
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

public boolean equals(Object other)
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:
equals in interface Collection<JDFAttributeMap>
Specified by:
equals in interface List<JDFAttributeMap>
Overrides:
equals in class Vector<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:
hashCode in interface Collection<JDFAttributeMap>
Specified by:
hashCode in interface List<JDFAttributeMap>
Overrides:
hashCode in class Vector<JDFAttributeMap>
Returns:
int

put

public void put(Object key,
                Object value)
put the key value pair into all entries

Parameters:
key - the key to set - may be either String or Enum
value - the value to set - may be either String or Enum
Throws:
IllegalArgumentException - if key or value have the wrong type

put

public void put(String key,
                String value)
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 set
value - the value to set

clone

public VJDFAttributeMap clone()
Overrides:
clone in class Vector<JDFAttributeMap>
Returns:
See Also:
Object.clone()

removeMaps

public void removeMaps(JDFAttributeMap map)
remove all matching maps from this i.e. if map is subMap of this

Parameters:
map -


Copyright © 2013. All Rights Reserved.