/
literal.php
65 lines (56 loc) · 1.52 KB
/
literal.php
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of literal
*
* @author root
*/
namespace literal;
use hecho\hecho;
class literal extends hecho {
private $oprel;
public static $IGUAL=0;
public static $MAYOR=1;
public static $MENOR=2;
public static $MAYOR_IGUAL=3;
public static $MENOR_IGUAL=4;
public static $DIFERENTE=5;
function __construct() {
}
function getOprel() {
return $this->oprel;
}
function setOprel($oprel) {
$this->oprel = $oprel;
}
function setHecho(hecho $hecho){
$this->setVariable($hecho->getVariable());
$this->setValor($hecho->getValor());
$this->setEsNumerico($hecho->getEsNumerico());
}
function getHecho(){
$h=new hecho();
$h->setValor($this->getValor());
$h->setEsNumerico($this->getEsNumerico());
$h->setVariable($this->getVariable());
return $h;
}
function igual($l){
if($l instanceof literal){
$igual;
$igual=($this->oprel==$l->getOprel()?TRUE:FALSE);
$igual=$igual&&$this->getHecho()->igual($l->getHecho());
}
return FALSE;
}
function clonar(){
$clon=new literal();
$clon->setHecho($this->getHecho()->clonar());
$clon->setOprel($this->getOprel());
return $clon;
}
}