Skip to content

Instantly share code, notes, and snippets.

@kallieb
kallieb / OOCheatSheet.java
Created April 8, 2018 20:32 — forked from john-science/OOCheatSheet.java
Java: an Objected Oriented Cheat Sheet
/**
* The basic class syntax.
*/
public class BasicClass {
public BasicClass() {
// This is the constructor.
}
// Brett & Kallie are adapting this code. We originally forked it from https://gist.github.com/chrisjacob/6026762
// Built with IMPACT - impactjs.org
(function (window) {
"use strict";
Number.prototype.map = function (istart, istop, ostart, ostop) {
return ostart + (ostop - ostart) * ((this - istart) / (istop - istart));
};
Number.prototype.limit = function (min, max) {
return Math.min(max, Math.max(min, this));