weka.associations.classification
Class CrListElement

java.lang.Object
  extended by weka.associations.classification.CrListElement
All Implemented Interfaces:
java.io.Serializable

public class CrListElement
extends java.lang.Object
implements java.io.Serializable

Class for list elements in the associated list of a CrTree. A CrTree(n-ary tree in child-sibling representation) can store classification association rules(CARs) and allows pruning and classification. Tree Structure described at: W. Li, J. Han, J.Pei: CMAR: Accurate and Efficient Classification Based on Multiple Class-Association Rules. In ICDM'01:369-376,2001. Each possible item of a rule premise is stored once in the associated list.

Version:
$Revision: 8108 $
Author:
Stefan Mutter
See Also:
Serialized Form

Constructor Summary
CrListElement(CrListElement pred, CrListElement succ, int num, int value, int i)
          Constructor that constructs a CrListElement and a CrNode to which the list element is pointing.
 
Method Summary
 boolean equals(int num, int value)
          Compares two CrListElements
 int[] getContent()
          Gets the item that is stored in a CrListElement.
 int getHeight()
          Gets the minimum height of all nodes in a CrTree that store the same item than the ListElement
 CrListElement getPred()
          Gets the predecessor
 CrNode getSiblingNode()
          Gets the node to wich the CrListElement is pointing
 CrListElement getSucc()
          Gets the successor
 void setContent(int[] insert)
          Sets the item that is stored in a CrListElement.
 void setHeight(int i)
          Sets the minimum height of all nodes in a CrTree that store the same item than the ListElement
 void setPred(CrListElement input)
          Sets the predecessor
 void setSiblingNode(CrNode sibling)
          Sets the node to wich the CrListElement is pointing
 void setSucc(CrListElement input)
          Sets the sucessor.
 java.lang.String toString()
          Methods that returns a string description for a CrListElement
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CrListElement

public CrListElement(CrListElement pred,
                     CrListElement succ,
                     int num,
                     int value,
                     int i)
Constructor that constructs a CrListElement and a CrNode to which the list element is pointing.

Parameters:
pred - the predecessor in the list
succ - the successor in the list
num - the attribute number
value - the attribute value
i - the minimum height
Method Detail

setPred

public void setPred(CrListElement input)
Sets the predecessor

Parameters:
input - a CrListElement

setSucc

public void setSucc(CrListElement input)
Sets the sucessor.

Parameters:
input - a CrListElement

setHeight

public void setHeight(int i)
Sets the minimum height of all nodes in a CrTree that store the same item than the ListElement

Parameters:
i - the minimum height

getHeight

public int getHeight()
Gets the minimum height of all nodes in a CrTree that store the same item than the ListElement

Returns:
the minimum hieght that is stored in that CrListElement

getPred

public CrListElement getPred()
Gets the predecessor

Returns:
the CrListElement that is preceding the actual element

getSucc

public CrListElement getSucc()
Gets the successor

Returns:
the CrListElement that comes after the actual element

getSiblingNode

public CrNode getSiblingNode()
Gets the node to wich the CrListElement is pointing

Returns:
a CrNode

setSiblingNode

public void setSiblingNode(CrNode sibling)
Sets the node to wich the CrListElement is pointing

Parameters:
sibling - a CrNode

getContent

public int[] getContent()
Gets the item that is stored in a CrListElement. Items are stored as an integer array [attribute number, attribute value]

Returns:
an integer array conating the item

setContent

public void setContent(int[] insert)
Sets the item that is stored in a CrListElement. Items are stored as an integer array [attribute number, attribute value]

Parameters:
insert - an integer array containing the attribute number and the attribute value

equals

public boolean equals(int num,
                      int value)
Compares two CrListElements

Parameters:
num - the attribute number
value - the attribute value
Returns:
true if the CrListElements store the same item, false otherwise

toString

public java.lang.String toString()
Methods that returns a string description for a CrListElement

Overrides:
toString in class java.lang.Object
Returns:
a string description of a CrListElement