biz.hammurapi.rules
Class KnowledgeMaximizingSet

java.lang.Object
  extended by biz.hammurapi.rules.KnowledgeMaximizingSet
All Implemented Interfaces:
java.lang.Iterable, java.util.Collection, java.util.Set

public class KnowledgeMaximizingSet
extends java.lang.Object
implements java.util.Set

This class "maximizes knowledge", which means when more specific (superceding) conclusions are added to the set less specific are removed. Conclusions less specific than present in the set are not added at all.

Author:
Pavel Vlasov

Constructor Summary
KnowledgeMaximizingSet()
          Constructs new KnowledgeMaximizingSet with java.util.HashSet as master.
KnowledgeMaximizingSet(java.util.Collection master)
           
 
Method Summary
 boolean add(java.lang.Object arg)
          Adds object if collection doesn't contain equal or superceding object.
 boolean addAll(java.util.Collection arg)
           
 void clear()
           
 boolean contains(java.lang.Object arg0)
           
 boolean containsAll(java.util.Collection arg0)
           
 boolean equals(java.lang.Object arg0)
           
 int hashCode()
           
 boolean isEmpty()
           
 java.util.Iterator iterator()
           
 boolean remove(java.lang.Object arg0)
           
 boolean removeAll(java.util.Collection arg0)
           
 boolean retainAll(java.util.Collection arg0)
           
 int size()
           
 java.lang.Object[] toArray()
           
 java.lang.Object[] toArray(java.lang.Object[] arg0)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KnowledgeMaximizingSet

public KnowledgeMaximizingSet(java.util.Collection master)
Parameters:
master - Master collection

KnowledgeMaximizingSet

public KnowledgeMaximizingSet()
Constructs new KnowledgeMaximizingSet with java.util.HashSet as master.

Method Detail

add

public boolean add(java.lang.Object arg)
Adds object if collection doesn't contain equal or superceding object.

Specified by:
add in interface java.util.Collection
Specified by:
add in interface java.util.Set

addAll

public boolean addAll(java.util.Collection arg)
Specified by:
addAll in interface java.util.Collection
Specified by:
addAll in interface java.util.Set

clear

public void clear()
Specified by:
clear in interface java.util.Collection
Specified by:
clear in interface java.util.Set

contains

public boolean contains(java.lang.Object arg0)
Specified by:
contains in interface java.util.Collection
Specified by:
contains in interface java.util.Set

containsAll

public boolean containsAll(java.util.Collection arg0)
Specified by:
containsAll in interface java.util.Collection
Specified by:
containsAll in interface java.util.Set

equals

public boolean equals(java.lang.Object arg0)
Specified by:
equals in interface java.util.Collection
Specified by:
equals in interface java.util.Set
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Collection
Specified by:
hashCode in interface java.util.Set
Overrides:
hashCode in class java.lang.Object

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection
Specified by:
isEmpty in interface java.util.Set

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.lang.Iterable
Specified by:
iterator in interface java.util.Collection
Specified by:
iterator in interface java.util.Set

remove

public boolean remove(java.lang.Object arg0)
Specified by:
remove in interface java.util.Collection
Specified by:
remove in interface java.util.Set

removeAll

public boolean removeAll(java.util.Collection arg0)
Specified by:
removeAll in interface java.util.Collection
Specified by:
removeAll in interface java.util.Set

retainAll

public boolean retainAll(java.util.Collection arg0)
Specified by:
retainAll in interface java.util.Collection
Specified by:
retainAll in interface java.util.Set

size

public int size()
Specified by:
size in interface java.util.Collection
Specified by:
size in interface java.util.Set

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection
Specified by:
toArray in interface java.util.Set

toArray

public java.lang.Object[] toArray(java.lang.Object[] arg0)
Specified by:
toArray in interface java.util.Collection
Specified by:
toArray in interface java.util.Set


Copyright © 2005 Hammurapi Group. All Rights Reserved.