Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2XB3FinalProject
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christopher Schankula
2XB3FinalProject
Commits
004fb22d
Commit
004fb22d
authored
7 years ago
by
Ray Liu
Browse files
Options
Downloads
Patches
Plain Diff
Added documentation to Date and Histogram
parent
015ea501
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/data/Date.java
+26
-5
26 additions, 5 deletions
src/data/Date.java
src/search/Histogram.java
+5
-0
5 additions, 0 deletions
src/search/Histogram.java
with
31 additions
and
5 deletions
src/data/Date.java
+
26
−
5
View file @
004fb22d
package
data
;
import
java.io.Serializable
;
public
class
Date
implements
Comparable
<
Date
>,
Serializable
{
/**
*
*
Date ADT for Records
*/
public
class
Date
implements
Comparable
<
Date
>,
Serializable
{
private
static
final
long
serialVersionUID
=
-
5256185778691324647L
;
private
final
int
year
;
private
final
int
month
;
private
final
int
day
;
/**
* Initializes the object
*/
public
Date
(
int
year
,
int
month
,
int
day
)
{
this
.
year
=
year
;
this
.
month
=
month
;
...
...
@@ -18,20 +21,38 @@ public class Date implements Comparable<Date>, Serializable {
}
/**
* Gets the year
*
* @return The year of the date
*/
public
int
getYear
()
{
return
this
.
year
;
}
/**
* Gets the month
*
* @return The month of the date
*/
public
int
getMonth
()
{
return
this
.
month
;
}
/**
* Gets the day
*
* @return The day of the date
*/
public
int
getDay
()
{
return
this
.
day
;
}
/**
* Gets the day
* @param other -date object that it's comparing to
* @return comparedToValue -1 if greater, -1 if smaller and 0 if equal
*/
public
int
compareTo
(
Date
other
)
{
if
(
this
.
year
>
other
.
getYear
())
return
1
;
...
...
This diff is collapsed.
Click to expand it.
src/search/Histogram.java
+
5
−
0
View file @
004fb22d
...
...
@@ -29,6 +29,11 @@ public class Histogram {
return
tree
;
}
/**
* Prints a histogram based on a BST of records
*
* @param record -An BST of records
*/
public
static
void
printHistogram
(
BST
<
Integer
,
Integer
>
record
)
{
int
max
=
0
;
int
scale
=
100
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment