jcolibri.util
Class AttributeUtils

java.lang.Object
  extended by jcolibri.util.AttributeUtils

public class AttributeUtils
extends java.lang.Object

Utility methods to manage the attributes of a case.

Version:
1.0
Author:
Juan A. Recio García
See Also:
Attribute

Constructor Summary
AttributeUtils()
           
 
Method Summary
static CaseComponent findBelongingComponent(Attribute at, CaseComponent cc)
          Finds the belonging component of an attribute.
static CaseComponent findBelongingComponent(Attribute at, CBRCase c)
          Similar to findBelongingComponent(Attribute, CaseComponent) as a CBRCase is a CaseComponent.
static CaseComponent findBelongingComponent(Attribute at, CBRQuery q)
          Similar to findBelongingComponent(Attribute, CaseComponent) as a CBRQuery is a CaseComponent.
static java.lang.Object findValue(Attribute at, CaseComponent cc)
          Returns the value of an Attribute in a CaseComponent object.
static java.lang.Object findValue(Attribute at, CBRCase c)
          Finds the value of an Attribute in a CBRCase object.
static java.lang.Object findValue(Attribute at, CBRQuery query)
          Finds the value of an Attribute in a CBRQuery object.
static java.util.Collection<Attribute> getAttributes(CaseComponent cc)
          Returns the list of attributes of a CaseComponents and all its sub-caseComponents.
static java.util.Collection<Attribute> getAttributes(CaseComponent cc, java.lang.Class _class)
          Returns the list of attributes of a CaseComponents and all its sub-caseComponents which values are instance of a given class
static Attribute[] getAttributes(java.lang.Class c)
          Returns the list of attributes of a class.
static void setValue(Attribute at, CaseComponent cc, java.lang.Object value)
          Returns the value of an Attribute in a CaseComponent object.
static void setValue(Attribute at, CBRCase c, java.lang.Object value)
          Finds the value of an Attribute in a CBRCase object.
static void setValue(Attribute at, CBRQuery query, java.lang.Object value)
          Finds the value of an Attribute in a CBRQuery object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeUtils

public AttributeUtils()
Method Detail

getAttributes

public static Attribute[] getAttributes(java.lang.Class c)
Returns the list of attributes of a class.


getAttributes

public static java.util.Collection<Attribute> getAttributes(CaseComponent cc)
Returns the list of attributes of a CaseComponents and all its sub-caseComponents.


getAttributes

public static java.util.Collection<Attribute> getAttributes(CaseComponent cc,
                                                            java.lang.Class _class)
Returns the list of attributes of a CaseComponents and all its sub-caseComponents which values are instance of a given class


findBelongingComponent

public static CaseComponent findBelongingComponent(Attribute at,
                                                   CaseComponent cc)
Finds the belonging component of an attribute. A case is a CaseComponent that can be composed by simple attributes or other CaseComponents. This method traverses the CaseComponents structure of a case to find the CaseComponent that an attribute belongs to.


findBelongingComponent

public static CaseComponent findBelongingComponent(Attribute at,
                                                   CBRQuery q)
Similar to findBelongingComponent(Attribute, CaseComponent) as a CBRQuery is a CaseComponent.


findBelongingComponent

public static CaseComponent findBelongingComponent(Attribute at,
                                                   CBRCase c)
Similar to findBelongingComponent(Attribute, CaseComponent) as a CBRCase is a CaseComponent.


findValue

public static java.lang.Object findValue(Attribute at,
                                         CaseComponent cc)
Returns the value of an Attribute in a CaseComponent object.


findValue

public static java.lang.Object findValue(Attribute at,
                                         CBRQuery query)
Finds the value of an Attribute in a CBRQuery object.


findValue

public static java.lang.Object findValue(Attribute at,
                                         CBRCase c)
Finds the value of an Attribute in a CBRCase object.


setValue

public static void setValue(Attribute at,
                            CaseComponent cc,
                            java.lang.Object value)
Returns the value of an Attribute in a CaseComponent object.


setValue

public static void setValue(Attribute at,
                            CBRQuery query,
                            java.lang.Object value)
Finds the value of an Attribute in a CBRQuery object.


setValue

public static void setValue(Attribute at,
                            CBRCase c,
                            java.lang.Object value)
Finds the value of an Attribute in a CBRCase object.


GAIA - Group for Artificial Intelligence Applications
http://gaia.fdi.ucm.es