-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShape.java
More file actions
40 lines (39 loc) · 1.09 KB
/
Copy pathShape.java
File metadata and controls
40 lines (39 loc) · 1.09 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
import java.awt.Graphics;
/**
* @author Furkan Ozev
* @since 17-01-2019
* Shape interface implements the Comparable interface.
*/
public interface Shape extends Comparable<Shape>
{
/**
* area that returns the area of the shape.
* @return double area of shape.
*/
public double area();
/**
* perimeter that returns the perimeter.
* @return double area of shape.
*/
public double perimeter();
/**
* Functions increment for incrementing the shape positions by 1.0.
*/
public void increment();
/**
* Functions decrement for decrementing the shape positions by 1.0.
*/
public void decrement();
/*
* This interface implements the Comparable interface to compare shapes with respect to their areas.
* if area big return 1, small return -1, equal return 0
* @see java.lang.Comparable#compareTo(java.lang.Object)
*/
public int compareTo( final Shape o);
/**
* Draw takes a Graphics object as parameter and draws the shape.
* This method will be called from the paintComponent method of a JPanel object.
* @param o Graphics object
*/
public void Draw(Graphics o);
}