Repository navigation
Expand file tree
/
Copy pathContent.java
More file actions
67 lines (50 loc) · 2.12 KB
/
Copy pathContent.java
File metadata and controls
67 lines (50 loc) · 2.12 KB
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
/**
*Parent class that holds content. important functionality includes content ID, string for content's content, and timestamp when it was created
*
* @author (Huy Nguyen)
* @version (2023-10-16)
*/
import java.time.LocalDateTime;
public class Content
{
//VARIABLES
private static long numContents = 0; //
//Static variable belonging to the class tracks number of users created. This is used to set the contentID, ensuring each one is unique as each one is
//set from the number of content objects created which goes up when a content is created.
private long lngContentID; //holds contentID of content -> int has been chosen because predicted maxium of 32767 UserProfiles each with predicted maximun 127 posts each with predcited maxium
//of 32767 means there could be a maxium of 136,356,888,703 comments alone, each with a content object. Thus, long has been chosen for data type to be able to store this number and greater
private String strContent; //holds string information of content
private LocalDateTime ldtTimeStamp; //holds when the content was created, giving it a timestamp for time of creation. Local date time has been used as it tracks year, month, date, and time
public Content(String strContent)
{
numContents++; //increase num of contents
this.lngContentID = numContents; //set content ID to new number of contents
this.strContent = strContent;
this.ldtTimeStamp = LocalDateTime.now(); //set timestamp to now
}
//GETTERS AND SETTERS
public void setContentID(long lngContentID)
{
this.lngContentID = lngContentID;
}
public void setContent(String strContent)
{
this.strContent = strContent;
}
public void setTimeStamp(LocalDateTime ldtTimeStamp)
{
this.ldtTimeStamp = ldtTimeStamp;
}
public long getContentID()
{
return this.lngContentID;
}
public String getContent()
{
return this.strContent;
}
public LocalDateTime getTimeStamp()
{
return this.ldtTimeStamp;
}
}