Foros del Web » Programación para mayores de 30 ;) » Java »

Ayuda para encontrar conceptos en estos ejemplos

Estas en el tema de Ayuda para encontrar conceptos en estos ejemplos en el foro de Java en Foros del Web. Holas: A partir de un par de clases que encontré en un ejemplo, estoy tratando de entender su funcionamiento y veo algunos conceptos que aplican ...
  #1 (permalink)  
Antiguo 08/07/2005, 10:19
Avatar de ko^ke  
Fecha de Ingreso: septiembre-2001
Ubicación: México D.F.
Mensajes: 364
Antigüedad: 22 años, 7 meses
Puntos: 1
Ayuda para encontrar conceptos en estos ejemplos

Holas:

A partir de un par de clases que encontré en un ejemplo, estoy tratando de entender su funcionamiento y veo algunos conceptos que aplican y me gustaria saber su opinión para ver si están de acuerdo conmigo.

En la siguiente clase veo la implementación de una clase Serializable, con Setter's y Getter's, sobre carga de metodos (Restaurant), el metodo .this que aun no entiendo su funcion , cabe destacar que las variables corresponden a una tabla de base de datos.

Código PHP:
package samples.restaurant;

import java.io.Serializable;

public class 
Restaurant implements Serializable {

    private 
int restaurantId;
    private 
String name;
    private 
String address;
    private 
String city;
    private 
String zip;
    private 
String phone;
    private 
String link;
    private 
String image;
    private 
String description;
    private 
String review;
    private 
double mapX;
    private 
double mapY;

    public 
Restaurant() {

    }

    public 
Restaurant(int restaurantIdString nameString addressString cityString zipString phoneString linkString imageString descriptionString review) {
        
this.restaurantId restaurantId;
        
this.name name;
        
this.address address;
        
this.city city;
        
this.zip zip;
        
this.phone phone;
        
this.link link;
        
this.image image;
        
this.description description;
        
this.review review;
    }

    public 
Restaurant(int restaurantIdString nameString addressString cityString zipString phoneString linkString imageString descriptionString reviewdouble mapXdouble mapY) {
        
this.restaurantId restaurantId;
        
this.name name;
        
this.address address;
        
this.city city;
        
this.zip zip;
        
this.phone phone;
        
this.link link;
        
this.image image;
        
this.description description;
        
this.review review;
        
this.mapX mapX;
        
this.mapY mapY;
    }


    public 
int getRestaurantId() {
        return 
restaurantId;
    }

    public 
void setRestaurantId(int restaurantId) {
        
this.restaurantId restaurantId;
    }

    public 
String getName() {
        return 
name;
    }

    public 
void setName(String name) {
        
this.name name;
    }

    public 
String getAddress() {
        return 
address;
    }

    public 
void setAddress(String address) {
        
this.address address;
    }

    public 
String getCity() {
        return 
city;
    }

    public 
void setCity(String city) {
        
this.city city;
    }

    public 
String getZip() {
        return 
zip;
    }

    public 
void setZip(String zip) {
        
this.zip zip;
    }

    public 
String getPhone() {
        return 
phone;
    }

    public 
void setPhone(String phone) {
        
this.phone phone;
    }

    public 
String getLink() {
        return 
link;
    }

    public 
void setLink(String link) {
        
this.link link;
    }

    public 
String getImage() {
        return 
image;
    }

    public 
void setImage(String image) {
        
this.image image;
    }

    public 
String getDescription() {
        return 
description;
    }

    public 
void setDescription(String description) {
        
this.description description;
    }

    public 
String getReview() {
        return 
review;
    }

    public 
void setReview(String review) {
        
this.review review;
    }

    public 
double getMapX() {
        return 
mapX;
    }

    public 
void setMapX(double mapX) {
        
this.mapX mapX;
    }

    public 
double getMapY() {
        return 
mapY;
    }

    public 
void setMapY(double mapY) {
        
this.mapY mapY;
    }

Continua en el siguiente post por cuentiones de espacio -solo permite 1000 caracteres-
__________________
Aquí va la firma...
  #2 (permalink)  
Antiguo 08/07/2005, 20:17
Avatar de Modern_Crusades  
Fecha de Ingreso: junio-2005
Mensajes: 620
Antigüedad: 18 años, 10 meses
Puntos: 1
el metodo this le dice a java que la accion o metodo, o variable invocada es perteneciente a esta clase y no a un padre(si es padre usas super) o hijo.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 17:01.