-
Notifications
You must be signed in to change notification settings - Fork 0
/
FCAAttribute.java
84 lines (72 loc) · 1.69 KB
/
FCAAttribute.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package lib.fca;
/*
* This library is an enhanced version of the
* FCAlib
* @see <a href="https://github.com/julianmendez/fcalib">https://github.com/julianmendez/fcalib</a>
* @author Leon Geis
* @version 0.1
*/
import api.fca.Attribute;
import java.util.ArrayList;
import java.util.List;
/**
* Describes a single Attribute with the
* corresponding Objects.
* @author Leon Geis
*/
public class FCAAttribute<O,A> implements Attribute<O,A> {
/**
* ID of the Attribute.
*/
private A attributeID;
/**
* List of Objects an Attribute has.
* Can be seen as a "x" in the given context
* for that Attribute.
*/
private List<O> objects;
/**
* Default constructor.
*/
public FCAAttribute(){
this.objects=new ArrayList<>();
this.attributeID=null;
}
/**
* Constructor of the class, which creates a new
* and empty List of Objects.
*/
public FCAAttribute(A id){
this.objects = new ArrayList<>();
this.attributeID = id;
}
/**
* Get ID of the Attribute.
* @return Attribute ID.
*/
public A getAttributeID() {
return this.attributeID;
}
/**
* Set Name of the Attribute.
* @param id ID of the name.
*/
public void setAttributeID(A id) {
this.attributeID = id;
}
/**
* Get all Objects, which have this attribute.
* @return List of Objects.
*/
@Override
public List<O> getDualEntities() {
return objects;
}
/**
* Adds an Object to the Attribute.
* @param object Object that has to be added.
*/
public void addObject(O object){
this.objects.add(object);
}
}