Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,3 +0,0 @@
|
|||
type Queue is limited interface;
|
||||
procedure Enqueue (Lounge : in out Queue; Item : in out Element) is abstract;
|
||||
procedure Dequeue (Lounge : in out Queue; Item : in out Element) is abstract;
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
type Scheduler is task interface;
|
||||
procedure Plan (Manager : in out Scheduler; Activity : in out Job) is abstract;
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
with Ada.Finalization;
|
||||
...
|
||||
type Node is abstract new Ada.Finalization.Limited_Controlled and Queue with record
|
||||
Previous : not null access Node'Class := Node'Unchecked_Access;
|
||||
Next : not null access Node'Class := Node'Unchecked_Access;
|
||||
end record;
|
||||
overriding procedure Finalize (X : in out Node); -- Removes the node from its list if any
|
||||
overriding procedure Dequeue (Lounge : in out Node; Item : in out Element);
|
||||
overriding procedure Enqueue (Lounge : in out Node; Item : in out Element);
|
||||
procedure Process (X : in out Node) is abstract; -- To be implemented
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
IDENTIFICATION DIVISION.
|
||||
INTERFACE-ID. Shape.
|
||||
|
||||
PROCEDURE DIVISION.
|
||||
|
||||
IDENTIFICATION DIVISION.
|
||||
METHOD-ID. perimeter.
|
||||
DATA DIVISION.
|
||||
LINKAGE SECTION.
|
||||
01 ret USAGE FLOAT-LONG.
|
||||
PROCEDURE DIVISION RETURNING ret.
|
||||
END METHOD perimeter.
|
||||
|
||||
IDENTIFICATION DIVISION.
|
||||
METHOD-ID. shape-area.
|
||||
DATA DIVISION.
|
||||
LINKAGE SECTION.
|
||||
01 ret USAGE FLOAT-LONG.
|
||||
PROCEDURE DIVISION RETURNING ret.
|
||||
END METHOD shape-area.
|
||||
|
||||
END INTERFACE Shape.
|
||||
|
||||
|
||||
IDENTIFICATION DIVISION.
|
||||
CLASS-ID. Rectangle.
|
||||
|
||||
ENVIRONMENT DIVISION.
|
||||
CONFIGURATION SECTION.
|
||||
REPOSITORY.
|
||||
INTERFACE Shape.
|
||||
|
||||
IDENTIFICATION DIVISION.
|
||||
OBJECT IMPLEMENTS Shape.
|
||||
DATA DIVISION.
|
||||
WORKING-STORAGE SECTION.
|
||||
01 width USAGE FLOAT-LONG PROPERTY.
|
||||
01 height USAGE FLOAT-LONG PROPERTY.
|
||||
|
||||
PROCEDURE DIVISION.
|
||||
|
||||
IDENTIFICATION DIVISION.
|
||||
METHOD-ID. perimeter.
|
||||
DATA DIVISION.
|
||||
LINKAGE SECTION.
|
||||
01 ret USAGE FLOAT-LONG.
|
||||
PROCEDURE DIVISION RETURNING ret.
|
||||
COMPUTE
|
||||
ret = width * 2.0 + height * 2.0
|
||||
END-COMPUTE
|
||||
GOBACK.
|
||||
END METHOD perimeter.
|
||||
|
||||
IDENTIFICATION DIVISION.
|
||||
METHOD-ID. shape-area.
|
||||
DATA DIVISION.
|
||||
LINKAGE SECTION.
|
||||
01 ret USAGE FLOAT-LONG.
|
||||
PROCEDURE DIVISION RETURNING ret.
|
||||
COMPUTE
|
||||
ret = width * height
|
||||
END-COMPUTE
|
||||
GOBACK.
|
||||
END METHOD shape-area.
|
||||
|
||||
END OBJECT.
|
||||
|
||||
END CLASS Rectangle.
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
interface Vocal {
|
||||
public function speak():String;
|
||||
}
|
||||
|
||||
interface Gravitational {
|
||||
public function getWeight():Int;
|
||||
}
|
||||
|
||||
abstract class Dog implements Vocal implements Gravitational {
|
||||
public function speak():String {
|
||||
return "Woof";
|
||||
}
|
||||
|
||||
public function new() {}
|
||||
}
|
||||
|
||||
class Chihuahua extends Dog {
|
||||
public function getWeight():Int {
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
|
||||
class GreatDane extends Dog {
|
||||
public function getWeight():Int {
|
||||
return 150;
|
||||
}
|
||||
}
|
||||
|
||||
class Main {
|
||||
static public function main():Void {
|
||||
var dogs:Array<Dog> = [];
|
||||
|
||||
var david = new Chihuahua();
|
||||
var goliath = new GreatDane();
|
||||
|
||||
dogs.push(david);
|
||||
dogs.push(goliath);
|
||||
|
||||
for (dog in dogs) {
|
||||
trace(dog.speak());
|
||||
trace(dog.getWeight());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
class abstraction()
|
||||
abstract method compare(l,r) # generates runerr(700, "method compare()")
|
||||
end
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
#Requires -Version 5.0
|
||||
|
||||
Class Player
|
||||
{
|
||||
<#
|
||||
Properties: Name, Team, Position and Number
|
||||
#>
|
||||
[string]$Name
|
||||
|
||||
[ValidateSet("Baltimore Ravens","Cincinnati Bengals","Cleveland Browns","Pittsburgh Steelers",
|
||||
"Chicago Bears","Detroit Lions","Green Bay Packers","Minnesota Vikings",
|
||||
"Houston Texans","Indianapolis Colts","Jacksonville Jaguars","Tennessee Titans",
|
||||
"Atlanta Falcons","Carolina Panthers","New Orleans Saints","Tampa Bay Buccaneers",
|
||||
"Buffalo Bills","Miami Dolphins","New England Patriots","New York Jets",
|
||||
"Dallas Cowboys","New York Giants","Philadelphia Eagles","Washington Redskins",
|
||||
"Denver Broncos","Kansas City Chiefs","Oakland Raiders","San Diego Chargers",
|
||||
"Arizona Cardinals","Los Angeles Rams","San Francisco 49ers","Seattle Seahawks")]
|
||||
[string]$Team
|
||||
|
||||
[ValidateSet("C","G","T","QB","RB","WR","TE","DT","DE","ILB","OLB","CB","S","K","H","LS","P","KOS","R")]
|
||||
[string]$Position
|
||||
|
||||
[ValidateRange(0,99)]
|
||||
[int]$Number
|
||||
|
||||
<#
|
||||
Constructor: Creates a new Player object, with the specified Name, Team, Position and Number.
|
||||
#>
|
||||
Player([string]$Name, [string]$Team, [string]$Position, [int]$Number)
|
||||
{
|
||||
$this.Name = (Get-Culture).TextInfo.ToTitleCase("$Name")
|
||||
$this.Team = (Get-Culture).TextInfo.ToTitleCase("$Team")
|
||||
$this.Position = $Position.ToUpper()
|
||||
$this.Number = $Number
|
||||
}
|
||||
|
||||
<#
|
||||
Methods: Trade the player to a different team (optional parameters for methods in PowerShell 5 classes are not available. Boo!!)
|
||||
An overloaded method is a method with the same name as another method but in a different context,
|
||||
in this case with different parameters.
|
||||
#>
|
||||
Trade([string]$NewTeam)
|
||||
{
|
||||
[string[]]$league = "Baltimore Ravens","Cincinnati Bengals","Cleveland Browns","Pittsburgh Steelers",
|
||||
"Chicago Bears","Detroit Lions","Green Bay Packers","Minnesota Vikings",
|
||||
"Houston Texans","Indianapolis Colts","Jacksonville Jaguars","Tennessee Titans",
|
||||
"Atlanta Falcons","Carolina Panthers","New Orleans Saints","Tampa Bay Buccaneers",
|
||||
"Buffalo Bills","Miami Dolphins","New England Patriots","New York Jets",
|
||||
"Dallas Cowboys","New York Giants","Philadelphia Eagles","Washington Redskins",
|
||||
"Denver Broncos","Kansas City Chiefs","Oakland Raiders","San Diego Chargers",
|
||||
"Arizona Cardinals","Los Angeles Rams","San Francisco 49ers","Seattle Seahawks"
|
||||
|
||||
if ($NewTeam -in $league | Where-Object {$_ -notmatch $this.Team})
|
||||
{
|
||||
$this.Team = (Get-Culture).TextInfo.ToTitleCase("$NewTeam")
|
||||
}
|
||||
else
|
||||
{
|
||||
throw "Invalid Team"
|
||||
}
|
||||
}
|
||||
|
||||
Trade([string]$NewTeam, [int]$NewNumber)
|
||||
{
|
||||
[string[]]$league = "Baltimore Ravens","Cincinnati Bengals","Cleveland Browns","Pittsburgh Steelers",
|
||||
"Chicago Bears","Detroit Lions","Green Bay Packers","Minnesota Vikings",
|
||||
"Houston Texans","Indianapolis Colts","Jacksonville Jaguars","Tennessee Titans",
|
||||
"Atlanta Falcons","Carolina Panthers","New Orleans Saints","Tampa Bay Buccaneers",
|
||||
"Buffalo Bills","Miami Dolphins","New England Patriots","New York Jets",
|
||||
"Dallas Cowboys","New York Giants","Philadelphia Eagles","Washington Redskins",
|
||||
"Denver Broncos","Kansas City Chiefs","Oakland Raiders","San Diego Chargers",
|
||||
"Arizona Cardinals","Los Angeles Rams","San Francisco 49ers","Seattle Seahawks"
|
||||
|
||||
if ($NewTeam -in $league | Where-Object {$_ -notmatch $this.Team})
|
||||
{
|
||||
$this.Team = (Get-Culture).TextInfo.ToTitleCase("$NewTeam")
|
||||
}
|
||||
else
|
||||
{
|
||||
throw "Invalid Team"
|
||||
}
|
||||
|
||||
if ($NewNumber -in 0..99)
|
||||
{
|
||||
$this.Number = $NewNumber
|
||||
}
|
||||
else
|
||||
{
|
||||
throw "Invalid Number"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
$player1 = [Player]::new("sam bradford", "philadelphia eagles", "qb", 7)
|
||||
$player1
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
$player1.Trade("minnesota vikings", 8)
|
||||
$player1
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
$player2 = [Player]::new("demarco murray", "philadelphia eagles", "rb", 29)
|
||||
$player2
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
$player2.Trade("tennessee titans")
|
||||
$player2
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
REBOL [
|
||||
Title: "Abstract Type"
|
||||
URL: http://rosettacode.org/wiki/Abstract_type
|
||||
]
|
||||
|
||||
; The "shape" class is an abstract class -- it defines the "pen"
|
||||
; property and "line" method, but "size" and "draw" are undefined and
|
||||
; unimplemented.
|
||||
|
||||
shape: make object! [
|
||||
pen: "X"
|
||||
size: none
|
||||
|
||||
line: func [count][loop count [prin self/pen] prin crlf]
|
||||
draw: does [none]
|
||||
]
|
||||
|
||||
; The "box" class inherits from "shape" and provides the missing
|
||||
; information for drawing boxes.
|
||||
|
||||
box: make shape [
|
||||
size: 10
|
||||
draw: does [loop self/size [line self/size]]
|
||||
]
|
||||
|
||||
; "rectangle" also inherits from "shape", but handles the
|
||||
; implementation very differently.
|
||||
|
||||
rectangle: make shape [
|
||||
size: 20x10
|
||||
draw: does [loop self/size/y [line self/size/x]]
|
||||
]
|
||||
|
||||
; Unlike some languages discussed, REBOL has absolutely no qualms
|
||||
; about instantiating an "abstract" class -- that's how I created the
|
||||
; derived classes of "rectangle" and "box", after all.
|
||||
|
||||
s: make shape [] s/draw ; Nothing happens.
|
||||
|
||||
print "A box:"
|
||||
b: make box [pen: "O" size: 5] b/draw
|
||||
|
||||
print "^/A rectangle:"
|
||||
r: make rectangle [size: 32x5] r/draw
|
||||
|
|
@ -1 +0,0 @@
|
|||
type t
|
||||
Loading…
Add table
Add a link
Reference in a new issue