|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.associations.tertius.LiteralSet
Class representing a set of literals, being either the body or the head of a rule.
Field Summary | |
private int |
m_counter
Counter for the number of counter-instances. |
private java.util.ArrayList |
m_counterInstances
Set of counter-instances of this part of the rule. |
private Literal |
m_lastLiteral
Last literal added to this set. |
private java.util.ArrayList |
m_literals
Literals contained in this set. |
private int |
m_numInstances
Number of instances in the data the set deals with. |
private int |
m_type
Type of properties expressed in this set (individual or parts properties). |
Constructor Summary | |
LiteralSet()
Constructor for a set that does not store its counter-instances. |
|
LiteralSet(Instances instances)
Constructor initializing the set of counter-instances to all the instances. |
Method Summary | |
void |
addElement(Literal element)
Add a Literal to this set. |
abstract boolean |
canKeep(Instance instance,
Literal newLit)
Test if an instance can be kept as a counter-instance, given a new literal. |
java.lang.Object |
clone()
Returns a shallow copy of this set. |
boolean |
contains(Literal lit)
Test if this LiteralSet contains a given Literal. |
boolean |
counterInstance(Instance instance)
Test if an instance is a counter-instance of this LiteralSet. |
boolean |
counterInstance(Instance individual,
Instance part)
Test if an individual instance, given a part instance of this individual, is a counter-instance of this LiteralSet. |
java.util.Iterator |
enumerateLiterals()
Enumerate the literals contained in this set. |
double |
getCounterInstancesFrequency()
Get the frequency of counter-instances of this LiteralSet in the data. |
int |
getCounterInstancesNumber()
Get the number of counter-instances of this LiteralSet. |
Literal |
getLastLiteral()
Give the last literal added to this set. |
int |
getType()
Give the type of properties in this set (individual or part properties). |
boolean |
hasMaxCounterInstances()
Test if all the intances are counter-instances. |
boolean |
isEmpty()
Test if this set is empty. |
abstract boolean |
isIncludedIn(Rule otherRule)
Test if this LiteralSet is included in a rule. |
boolean |
negationIncludedIn(LiteralSet otherSet)
Test if the negation of this LiteralSet is included in another LiteralSet. |
int |
numLiterals()
Give the number of literals in this set. |
boolean |
overFrequencyThreshold(double minFrequency)
Test if this LiteralSet has more counter-instances than the threshold. |
abstract java.lang.String |
toString()
Gives a String representation for this set of literals. |
void |
upDate(Instances instances)
Update the number of counter-instances of this set in the dataset. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private java.util.ArrayList m_literals
private Literal m_lastLiteral
private int m_numInstances
private java.util.ArrayList m_counterInstances
private int m_counter
private int m_type
Constructor Detail |
public LiteralSet()
public LiteralSet(Instances instances)
instances
- The dataset.Method Detail |
public java.lang.Object clone()
public void upDate(Instances instances)
instances
- The dataset.public int getCounterInstancesNumber()
public double getCounterInstancesFrequency()
public boolean overFrequencyThreshold(double minFrequency)
minFrequency
- The frequency threshold.
public boolean hasMaxCounterInstances()
public void addElement(Literal element)
element
- The element to add.public final boolean isEmpty()
public final int numLiterals()
public final java.util.Iterator enumerateLiterals()
public Literal getLastLiteral()
public boolean negationIncludedIn(LiteralSet otherSet)
otherSet
- The other LiteralSet.
public boolean contains(Literal lit)
lit
- The literal that is looked for.
public int getType()
public boolean counterInstance(Instance individual, Instance part)
individual
- The individual instance.part
- The part instance.
public boolean counterInstance(Instance instance)
instance
- The instance to test.
public abstract boolean canKeep(Instance instance, Literal newLit)
instance
- The instance to test.newLit
- The new literal.
public abstract boolean isIncludedIn(Rule otherRule)
otherRule
- The rule to test.
public abstract java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |