|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectargutia.logic.syntax.SyntacticUnit
argutia.logic.PropositionalVariable
@Immutable public class PropositionalVariable
En logique propositionnelle, une variable propositionnelle représente une proposition, c'est-à-dire une entité ayant pour valeurs possibles vrai ou faux. Une variable propositionnelle possède une orthographe constituée d'un ou plusieurs caractères choisis par l'utilisateur.
PropositionalVariableTest
Field Summary | |
---|---|
static String |
CARACTERE
Définit ce qu'est un caractère au sein d'une variable propositionnelle via une expression régulière. |
private NegativeLiteral |
oppose
Littéral opposé, c'est-à-dire la négation de la variable propositionnelle. |
private String |
orthographe
Orthographe de la variable propositionnelle. |
static String |
RB_ILLEGAL_ARGUMENT_EXCEPTION
|
static String |
RB_KEY_ALREADY_EXISTS_EXCEPTION
|
private static Map<String,PropositionalVariable> |
VALUES
Map répertoriant les différentes instances de PropositionalVariable . |
Constructor Summary | |
---|---|
private |
PropositionalVariable(String orthographe)
Crée une variable propositionnelle avec pour orthographe celle spécifiée. |
Method Summary | |
---|---|
NegativeLiteral |
getOppose()
Retourne le littéral opposé, c'est-à-dire la négation de cette variable propositionnelle. |
static PropositionalVariable |
getOrNew(String orthographe)
Retourne la variable propositionnelle dont l'orthographe correspond à celle fourni en paramètre. |
static boolean |
isSyntaxValid(String s)
Retourne true si la chaîne s est constituée d'un ou plusieurs
caractères. |
String |
toString()
Retourne l'orthographe de la variable propositionnelle. |
void |
toStyledString(BatchStyledDocument doc)
Ajoute du style au résultat d'un appel à toString() et l'ajoute en attente
d'insertion dans le document spécifié. |
Methods inherited from class argutia.logic.syntax.SyntacticUnit |
---|
equals, hashCode |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String CARACTERE
Pattern
,
Constant Field Values"(?:\\p{L}|\\d|_)"
@ResourceBundle(value="argutia.argutia") public static final String RB_ILLEGAL_ARGUMENT_EXCEPTION
PropositionalVariable(String)
,
Constant Field Values"propositional_variable.illegal_argument_exception"
@ResourceBundle(value="argutia.argutia") public static final String RB_KEY_ALREADY_EXISTS_EXCEPTION
PropositionalVariable(String)
,
Constant Field Values"propositional_variable.key_already_exists_exception"
private static final Map<String,PropositionalVariable> VALUES
PropositionalVariable
.
private final NegativeLiteral oppose
PropositionalVariable(String)
.private final String orthographe
Constructor Detail |
---|
private PropositionalVariable(String orthographe) throws KeyAlreadyExistsException, IllegalArgumentException
orthographe
- orthographe de la nouvelle variable
propositionnelle.
KeyAlreadyExistsException
- si une variable propositionnelle avec la même orthographe
a déjà été créée.
IllegalArgumentException
- si la syntaxe de la variable propositionnelle n'est pas
conforme selon isSyntaxValid(String).Method Detail |
---|
public static PropositionalVariable getOrNew(String orthographe) throws IllegalArgumentException
PropositionalVariable(String)
PropositionalVariableTest.testGetOrNew()
orthographe
- orthographe pour laquelle on recherche ou crée une variable
propositionnelle.
IllegalArgumentException
- si la syntaxe de la variable propositionnelle n'est pas
conforme selon isSyntaxValid(String).public static boolean isSyntaxValid(String s)
true
si la chaîne s
est constituée d'un ou plusieurs
caractères.
PropositionalVariableTest.testIsSyntaxValid()
s
- chaîne que l'on examine.
true
si la chaîne s
est constituée d'un ou plusieurs
caractères.
public NegativeLiteral getOppose()
getOppose
in interface Literal
PropositionalVariableTest.testGetOppose()
public String toString()
toString
in class Object
public void toStyledString(BatchStyledDocument doc)
toString()
et l'ajoute en attente
d'insertion dans le document spécifié.
toStyledString
in interface AffichableAvecStyle
MyStyles
doc
- BatchStyledDocument
auquel on veut ajouter du texte mis en forme.
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |