org.drools.factmodel.traits
Class TraitTypeMap<T extends String,K extends Thing<C>,C>

java.lang.Object
  extended by org.drools.util.AbstractCodedHierarchyImpl<T>
      extended by org.drools.factmodel.traits.TypeHierarchy<Key<Thing<C>>>
          extended by org.drools.factmodel.traits.TraitTypeMap<T,K,C>
All Implemented Interfaces:
Externalizable, Serializable, Map<String,Thing<C>>, TypeLattice<Key<Thing<C>>>, CodedHierarchy<Key<Thing<C>>>

public class TraitTypeMap<T extends String,K extends Thing<C>,C>
extends TypeHierarchy<Key<Thing<C>>>
implements Map<String,Thing<C>>, Externalizable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.drools.util.AbstractCodedHierarchyImpl
AbstractCodedHierarchyImpl.HierCodeComparator, AbstractCodedHierarchyImpl.HierNode<T>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class org.drools.util.AbstractCodedHierarchyImpl
fixedRoot, line
 
Constructor Summary
TraitTypeMap()
           
TraitTypeMap(Map map)
           
 
Method Summary
 void clear()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set<Map.Entry<String,Thing<C>>> entrySet()
           
 Thing<C> get(Object key)
           
 BitSet getCurrentTypeCode()
           
 Collection<Key<Thing<C>>> getMostSpecificTraits()
           
 boolean isEmpty()
           
 Set<String> keySet()
           
 Thing<C> put(String key, Thing<C> value)
           
 void putAll(Map<? extends String,? extends Thing<C>> m)
           
 Thing<C> putSafe(String key, Thing<C> value)
           
 void readExternal(ObjectInput objectInput)
           
 Thing<C> remove(Object key)
           
 Collection<Thing<C>> removeCascade(BitSet code)
           
 Collection<Thing<C>> removeCascade(String traitName)
           
 void setBottomCode(BitSet code)
           
 int size()
           
 String toString()
           
 Collection<Thing<C>> values()
           
 void writeExternal(ObjectOutput objectOutput)
           
 
Methods inherited from class org.drools.factmodel.traits.TypeHierarchy
getBottomCode, getNode, getTopCode, setTopCode
 
Methods inherited from class org.drools.util.AbstractCodedHierarchyImpl
add, addMember, ancestorNodes, ancestors, ancestors, ancestorValues, children, children, childrenValues, contains, descendantNodes, descendants, descendants, descendantValues, getCode, getMember, getNodeByKey, getNodes, getSortedMap, getSortedMembers, hasKey, immediateChildren, immediateParents, joinCode, jointMembersCode, lowerBorder, lowerDescendants, meetCode, metMembersCode, numBit, parents, parents, parentValues, remove, removeMember, removeMember, stringToBitSet, supersetOrEqualset, toBinaryString, toBinaryString, upperAncestors, upperBorder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 
Methods inherited from interface org.drools.util.CodedHierarchy
addMember, ancestors, ancestors, children, children, descendants, descendants, getCode, getMember, getSortedMap, getSortedMembers, hasKey, immediateChildren, immediateParents, joinCode, jointMembersCode, lowerBorder, lowerDescendants, meetCode, metMembersCode, parents, parents, removeMember, removeMember, upperAncestors, upperBorder
 

Constructor Detail

TraitTypeMap

public TraitTypeMap()

TraitTypeMap

public TraitTypeMap(Map map)
Method Detail

size

public int size()
Specified by:
size in interface Map<String,Thing<C>>
Specified by:
size in interface CodedHierarchy<Key<Thing<C>>>
Overrides:
size in class AbstractCodedHierarchyImpl<Key<Thing<C>>>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map<String,Thing<C>>
Overrides:
isEmpty in class AbstractCodedHierarchyImpl<Key<Thing<C>>>

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<String,Thing<C>>

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map<String,Thing<C>>

get

public Thing<C> get(Object key)
Specified by:
get in interface Map<String,Thing<C>>

put

public Thing<C> put(String key,
                    Thing<C> value)
Specified by:
put in interface Map<String,Thing<C>>

setBottomCode

public void setBottomCode(BitSet code)
Specified by:
setBottomCode in interface TypeLattice<Key<Thing<C>>>
Overrides:
setBottomCode in class TypeHierarchy<Key<Thing<C>>>

putSafe

public Thing<C> putSafe(String key,
                        Thing<C> value)
                 throws LogicalTypeInconsistencyException
Throws:
LogicalTypeInconsistencyException

remove

public Thing<C> remove(Object key)
Specified by:
remove in interface Map<String,Thing<C>>

removeCascade

public Collection<Thing<C>> removeCascade(String traitName)

removeCascade

public Collection<Thing<C>> removeCascade(BitSet code)

putAll

public void putAll(Map<? extends String,? extends Thing<C>> m)
Specified by:
putAll in interface Map<String,Thing<C>>

clear

public void clear()
Specified by:
clear in interface Map<String,Thing<C>>
Overrides:
clear in class AbstractCodedHierarchyImpl<Key<Thing<C>>>

keySet

public Set<String> keySet()
Specified by:
keySet in interface Map<String,Thing<C>>

values

public Collection<Thing<C>> values()
Specified by:
values in interface Map<String,Thing<C>>

entrySet

public Set<Map.Entry<String,Thing<C>>> entrySet()
Specified by:
entrySet in interface Map<String,Thing<C>>

toString

public String toString()
Overrides:
toString in class TypeHierarchy<Key<Thing<C>>>

writeExternal

public void writeExternal(ObjectOutput objectOutput)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class TypeHierarchy<Key<Thing<C>>>
Throws:
IOException

readExternal

public void readExternal(ObjectInput objectInput)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class TypeHierarchy<Key<Thing<C>>>
Throws:
IOException
ClassNotFoundException

getMostSpecificTraits

public Collection<Key<Thing<C>>> getMostSpecificTraits()

getCurrentTypeCode

public BitSet getCurrentTypeCode()


Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.