ASDV-Java/Semester 3/Assignments/lab7-chapter20_CalebFontenot/Printed HTMLs/GeometricObject.html

90 lines
6.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>GeometricObject.java</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
.string {color: #6a8759}
.comment {color: #808080}
.whitespace {color: #505050}
.literal {color: #cc7832}
-->
</style>
</head>
<body>
<table width="100%"><tr><td align="center">/home/caleb/ASDV-Java/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/GeometricObject.java</td></tr></table>
<pre>
<span class="comment">/*</span>
<span class="comment"> * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license</span>
<span class="comment"> * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template</span>
<span class="comment"> */</span>
<span class="literal">package</span> edu.slcc.asdv.caleb.javafxballswithcomparator;
<span class="comment">/**</span>
<span class="comment"> *</span>
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">caleb</span>
<span class="comment">*/</span>
<span class="literal">public</span> <span class="literal">abstract</span> <span class="literal">class</span> GeometricObject {
<span class="literal">private</span> String color = <span class="string">&quot;</span><span class="string">white</span><span class="string">&quot;</span>;
<span class="literal">private</span> <span class="literal">boolean</span> filled;
<span class="literal">private</span> java.util.Date dateCreated;
<span class="comment">/**</span> <span class="comment">Construct</span> <span class="comment">a</span> <span class="comment">default</span> <span class="comment">geometric</span> <span class="comment">object</span> <span class="comment">*/</span>
<span class="literal">protected</span> GeometricObject() {
dateCreated = <span class="literal">new</span> java.util.Date();
}
<span class="comment">/**</span> <span class="comment">Construct</span> <span class="comment">a</span> <span class="comment">geometric</span> <span class="comment">object</span> <span class="comment">with</span> <span class="comment">color</span> <span class="comment">and</span> <span class="comment">filled</span> <span class="comment">value</span> <span class="comment">*/</span>
<span class="literal">protected</span> GeometricObject(String color, <span class="literal">boolean</span> filled) {
dateCreated = <span class="literal">new</span> java.util.Date();
<span class="literal">this</span>.color = color;
<span class="literal">this</span>.filled = filled;
}
<span class="comment">/**</span> <span class="comment">Return</span> <span class="comment">color</span> <span class="comment">*/</span>
<span class="literal">public</span> String getColor() {
<span class="literal">return</span> color;
}
<span class="comment">/**</span> <span class="comment">Set</span> <span class="comment">a</span> <span class="comment">new</span> <span class="comment">color</span> <span class="comment">*/</span>
<span class="literal">public</span> <span class="literal">void</span> setColor(String color) {
<span class="literal">this</span>.color = color;
}
<span class="comment">/**</span> <span class="comment">Return</span> <span class="comment">filled</span><span class="comment">.</span> <span class="comment">Since</span> <span class="comment">filled</span> <span class="comment">is</span> <span class="comment">boolean</span><span class="comment">,</span>
<span class="comment"> * </span><span class="comment">the</span> <span class="comment">get</span> <span class="comment">method</span> <span class="comment">is</span> <span class="comment">named</span> <span class="comment">isFilled</span> <span class="comment">*/</span>
<span class="literal">public</span> <span class="literal">boolean</span> isFilled() {
<span class="literal">return</span> filled;
}
<span class="comment">/**</span> <span class="comment">Set</span> <span class="comment">a</span> <span class="comment">new</span> <span class="comment">filled</span> <span class="comment">*/</span>
<span class="literal">public</span> <span class="literal">void</span> setFilled(<span class="literal">boolean</span> filled) {
<span class="literal">this</span>.filled = filled;
}
<span class="comment">/**</span> <span class="comment">Get</span> <span class="comment">dateCreated</span> <span class="comment">*/</span>
<span class="literal">public</span> java.util.Date getDateCreated() {
<span class="literal">return</span> dateCreated;
}
@Override
<span class="literal">public</span> String toString() {
<span class="literal">return</span> <span class="string">&quot;</span><span class="string">created on </span><span class="string">&quot;</span> + dateCreated + <span class="string">&quot;</span><span class="literal">\n</span><span class="string">color: </span><span class="string">&quot;</span> + color +
<span class="string">&quot;</span><span class="string"> and filled: </span><span class="string">&quot;</span> + filled;
}
<span class="comment">/**</span> <span class="comment">Abstract</span> <span class="comment">method</span> <span class="comment">getArea</span> <span class="comment">*/</span>
<span class="literal">public</span> <span class="literal">abstract</span> <span class="literal">double</span> getArea();
<span class="comment">/**</span> <span class="comment">Abstract</span> <span class="comment">method</span> <span class="comment">getPerimeter</span> <span class="comment">*/</span>
<span class="literal">public</span> <span class="literal">abstract</span> <span class="literal">double</span> getPerimeter();
}
</pre></body>
</html>