public Boolean intersecta(Intervalo intervalo) { Debug.Assert(intervalo != null); return(this.incluye(intervalo.getInferior()) || this.incluye(intervalo.getSuperior()) || intervalo.incluye(this)); }
internal int getOpcion() { GestorIO gestorIO = new GestorIO(); int opcion; Boolean error; do { gestorIO.mostrar("\nOpción? [1-9]: "); opcion = gestorIO.inInt(); error = !OPCIONES.incluye(opcion); if (error) { gestorIO.mostrar("Error!!! La opción debe ser entre 1 y 9"); } } while (error); return(opcion); }
public Intervalo interseccion(Intervalo intervalo) { Debug.Assert(this.intersecta(intervalo)); if (this.incluye(intervalo)) { return(intervalo.clone()); } else if (intervalo.incluye(this)) { return(this.clone()); } else if (this.incluye(intervalo.getInferior())) { return(new Intervalo(intervalo.getInferior(), getSuperior())); } else { return(new Intervalo(getInferior(), intervalo.getSuperior())); } }
private bool rojo() { return(ROJOS.incluye(palo)); }
private bool negro() { return(NEGROS.incluye(palo)); }