This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
magik-demo:developer:class:core:relation [2013/07/19 15:50] alex [Class Attributes] |
magik-demo:developer:class:core:relation [2017/07/06 15:24] (current) |
||
|---|---|---|---|
| Line 16: | Line 16: | ||
| </code> | </code> | ||
| - | ===== Class Constructor ===== | + | ===== Class Constructors ===== |
| ==== Relation ==== | ==== Relation ==== | ||
| <code java> | <code java> | ||
| Line 24: | Line 24: | ||
| java.lang.String description) | java.lang.String description) | ||
| </code> | </code> | ||
| + | Constructor for relation with well known arity. Attributes are load inside the function by calling ''[[#readattributesnamesindescription|readAttributesNamesInDescritpion]]''\\ | ||
| + | |||
| + | //Called by:// | ||
| + | * it.unibz.inf.magik.additional.InvolvedVariablesDetector | ||
| + | * it.unibz.inf.magik.db.DatabaseConnector | ||
| + | * it.unibz.inf.magik.test.CycleDetectionTest | ||
| + | * it.unibz.inf.magik.test.TestFK | ||
| + | * it.unibz.inf.magik.test.TestFK2 | ||
| + | * it.unibz.inf.magik.test.TestHardCaseFDCandFK | ||
| + | * it.unibz.inf.magik.test.TestTCQCReasonerBlackWhiteExample | ||
| + | * it.unibz.inf.magik.test.TestTCQCReasonerPlainCompanyEx | ||
| + | * it.unibz.inf.magik.test.TestValQueryProblem | ||
| + | * it.unibz.inf.magik.test.TestTCQCReasonerUnderFDC | ||
| + | * it.unibz.inf.magik.test.TestQueryClass | ||
| + | * it.unibz.inf.magik.test.TestQueryGeneralization | ||
| + | * it.unibz.inf.magik.test.TestQueryToSQL | ||
| + | * it.unibz.inf.magik.test.TestTCQCReasonerFKandFD | ||
| + | * it.unibz.inf.magik.test.TestTCQCReasonerPlainSchoolEx | ||
| + | * it.unibz.inf.magik.test.TestTCQCReasonerTCSuggestions | ||
| + | * it.unibz.inf.magik.test.TestPrimaryVioation | ||
| + | **Parameters:** | ||
| + | * name - name of the relation | ||
| + | * arity - arity of the relation | ||
| + | * primaryKey - determined with first place in the relation | ||
| + | * description - string of the attributes of the relation, separated by comma | ||
| + | |||
| + | |||
| + | ---- | ||
| + | ==== Relation ==== | ||
| + | <code java> | ||
| + | public Relation (java.lang.String name, | ||
| + | int primaryKey, | ||
| + | java.lang.String description) | ||
| + | </code> | ||
| + | Constructor for relation without knowning arity. Attributes are load inside the function by calling ''[[#readattributesnamesindescription|readAttributesNamesInDescritpion]]''\\ | ||
| + | |||
| + | //Called by:// | ||
| + | * it.unibz.inf.magik.web.SessionControl | ||
| + | * it.unibz.inf.magik.test.TestSimpleComparison | ||
| + | **Parameters:** | ||
| + | * name - name of the relation | ||
| + | * primaryKey - determined with first place in the relation | ||
| + | * description - string of the attributes of the relation, separated by comma | ||
| + | ===== Class Methods ===== | ||
| + | |||
| + | ==== readAttributesNamesInDescription ==== | ||
| + | <code java> | ||
| + | public static java.util.ArrayList<java.lang.String> readAttributesNamesInDescription(java.lang.String description) | ||
| + | </code> | ||
| + | Parse the attribute name of a relation from the description field | ||
| + | |||
| + | **Parameters:** | ||
| + | * description - string with attributes separated by comma | ||
| + | **Returns:** | ||
| + | * list of the attribute parsed | ||
| + | |||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== getAttributePosition ==== | ||
| + | <code java> | ||
| + | public int getAttributePosition (java.lang.String attributeName) | ||
| + | </code> | ||
| + | Get attribute position in the relation | ||
| + | |||
| + | **Parameters:** | ||
| + | * attributeName - attribute to search | ||
| + | **Returns:** | ||
| + | * position in the relation, //-1// if not in the relation | ||
| + | |||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== getters and setters methods ==== | ||
| + | |||
| + | <code java> | ||
| + | public java.util.ArrayList<java.lang.String> getAttributeNames() | ||
| + | public void setAttributeNames(java.util.ArrayList<java.lang.String> attributeNames) | ||
| + | |||
| + | public java.lang.String getName() | ||
| + | public void setName(java.lang.String name) | ||
| + | |||
| + | public int getArity() | ||
| + | public void setArity(int arity) | ||
| + | |||
| + | public int getPrimaryKey() | ||
| + | public void setPrimaryKey(int primaryKey) | ||
| + | |||
| + | public long getId() | ||
| + | public void setId(long id) | ||
| + | |||
| + | </code> | ||
| + | |||
| + | [[magik-demo:developer:class:core:relation|Back to Top]] | [[magik-demo:start|Back to Home Page]] | ||