
/* Java class "Emprestimo.java" generated from Poseidon for UML.
 *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
 *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
 */
package locadora.core;

import java.lang.*;
import java.util.*;

/**
 * <p>
 * 
 * </p>
 * 
 */
public class Emprestimo {

  ///////////////////////////////////////
  // attributes


/**
 * <p>
 * Represents ...
 * </p>
 */
    private Date dataLocacao; 

/**
 * <p>
 * Represents ...
 * </p>
 */
    private Date dataDevolucao; 

/**
 * <p>
 * Represents ...
 * </p>
 */
    private double valorAlguel; 

/**
 * <p>
 * Represents ...
 * </p>
 */
    private int status; 

/**
 * <p>
 * Represents ...
 * </p>
 */
    public static final int FINALIZADO = 2; 

/**
 * <p>
 * Represents ...
 * </p>
 */
    public static final int EM_ANDAMENTO = 1; 

/**
 * <p>
 * Represents ...
 * </p>
 */
    public static final int ATRASADO = -1; 

   ///////////////////////////////////////
   // associations

/**
 * <p>
 * 
 * </p>
 */
    public Cliente cliente; 
/**
 * <p>
 * 
 * </p>
 */
    public Collection videos = new TreeSet(); // of type Video


   ///////////////////////////////////////
   // access methods for associations

    /** @poseidon-generated */
    public Cliente getCliente() {
        return cliente;
    }
    /** @poseidon-generated */
    public void setCliente(Cliente cliente) {
        if (this.cliente != cliente) {
            if (this.cliente != null) this.cliente.removeEmprestimos(this);
            this.cliente = cliente;
            if (cliente != null) cliente.addEmprestimos(this);
        }
    }
    /** @poseidon-generated */
    public Collection getVideoss() {
        return videos;
    }
     /** @poseidon-generated */
    public void addVideos(Video video) {
        if (! this.videos.contains(video)) {
            this.videos.add(video);
            video.addEmprestimos(this);
        }
    }
    /** @poseidon-generated */
    public void removeVideos(Video video) {
        boolean removed = this.videos.remove(video);
        if (removed) video.removeEmprestimos(this);
    }


  ///////////////////////////////////////
  // operations


/**
 * <p>
 * Does ...
 * </p>
 * 
 * 
 * @return 
 */
    public int getStatus() {        
        return status;
    } // end getStatus        

/**
 * <p>
 * Does ...
 * </p>
 * 
 * 
 * @param _status 
 */
    public void setStatus(int _status) {        
        status = _status;
    } // end setStatus        

/**
 * <p>
 * Does ...
 * </p>
 * 
 * 
 * @return 
 */
    public Date getDataLocacao() {        
        return dataLocacao;
    } // end getDataLocacao        

/**
 * <p>
 * Does ...
 * </p>
 * 
 * 
 * @param _dataLocacao 
 */
    public void setDataLocacao(Date _dataLocacao) {        
        dataLocacao = _dataLocacao;
    } // end setDataLocacao        

/**
 * <p>
 * Does ...
 * </p>
 * 
 * 
 * @return 
 */
    public Date getDataDevolucao() {        
        return dataDevolucao;
    } // end getDataDevolucao        

/**
 * <p>
 * Does ...
 * </p>
 * 
 * 
 * @param _dataDevolucao 
 */
    public void setDataDevolucao(Date _dataDevolucao) {        
        dataDevolucao = _dataDevolucao;
    } // end setDataDevolucao        

/**
 * <p>
 * Does ...
 * </p>
 * 
 * 
 * @return 
 */
    public String toString() {        
        // your code here
        return cliente.toString()+" - "+dataDevolucao.toString();
    } // end toString        

/**
 * <p>
 * Does ...
 * </p>
 * 
 * 
 * @return 
 */
    public double getValorAlguel() {        
        return valorAlguel;
    } // end getValorAlguel        

/**
 * <p>
 * Does ...
 * </p>
 * 
 * 
 * @param _valorAlguel 
 */
    public void setValorAlguel(double _valorAlguel) {        
        valorAlguel = _valorAlguel;
    } // end setValorAlguel        

 } // end Emprestimo




