/*******************************************************************************
* Gisgraphy Project
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
*
* Copyright 2008 Gisgraphy project
* David Masclet <davidmasclet@gisgraphy.com>
*
*
*******************************************************************************/
package com.gisgraphy.importer.dto;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.Point;
/**
* Represents a house number as a simple node in the Karlsruhe schema.
*
* @author <a href="mailto:david.masclet@gisgraphy.com">David Masclet</a>
*/
public class NodeHouseNumber {
public NodeHouseNumber(Point location, String houseNumber, String name,
String streetName, String city, String zipCode, String suburb) {
super();
this.location = location;
this.houseNumber = houseNumber;
this.name = name;
this.streetName = streetName;
this.city = city;
this.zipCode = zipCode;
this.suburb = suburb;
}
public NodeHouseNumber() {
super();
}
public NodeHouseNumber(String nodeId, Point location, String houseNumber, String name, String streetName,String city,String zipCode,String suburb,Geometry shape) {
super();
this.nodeId = nodeId;
this.location = location;
this.houseNumber = houseNumber;
this.name = name;
this.streetName = streetName;
this.city=city;
this.zipCode = zipCode;
this.suburb = suburb;
this.shape = shape;
}
/**
* the id ow the way
*/
private String nodeId;
/**
* the gis location of the member (middle point or location )
*/
private Point location;
/**
* the number of the house. It is a string because of latin that is can have bis ter or a letter (3c)
*/
private String houseNumber;
/**
* the name of the house or the amenity
*/
private String name;
/**
* the name of the street associated to the way, not to the node
*/
private String streetName;
private String city;
private String zipCode;
private String suburb;
private Geometry shape;
/**
* @return the city
*/
public String getCity() {
return city;
}
/**
* @param city the city to set
*/
public void setCity(String city) {
this.city = city;
}
/**
* @return the zipCode
*/
public String getZipCode() {
return zipCode;
}
/**
* @param zipCode the zipCode to set
*/
public void setZipCode(String zipCode) {
this.zipCode = zipCode;
}
/**
* @return the suburb
*/
public String getSuburb() {
return suburb;
}
/**
* @param suburb the suburb to set
*/
public void setSuburb(String suburb) {
this.suburb = suburb;
}
/**
* @return the shape
*/
public Geometry getShape() {
return shape;
}
/**
* @param shape the shape to set
*/
public void setShape(Geometry shape) {
this.shape = shape;
}
/**
* @return the nodeId
*/
public String getNodeId() {
return nodeId;
}
/**
* @param nodeId the nodeId to set
*/
public void setNodeId(String nodeId) {
this.nodeId = nodeId;
}
/**
* @return the location
*/
public Point getLocation() {
return location;
}
/**
* @param location the location to set
*/
public void setLocation(Point location) {
this.location = location;
}
/**
* @return the houseNumber
*/
public String getHouseNumber() {
return houseNumber;
}
/**
* @param houseNumber the houseNumber to set
*/
public void setHouseNumber(String houseNumber) {
this.houseNumber = houseNumber;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the streetName
*/
public String getStreetName() {
return streetName;
}
/**
* @param streetName the streetName to set
*/
public void setStreetName(String streetName) {
this.streetName = streetName;
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((houseNumber == null) ? 0 : houseNumber.hashCode());
result = prime * result + ((location == null) ? 0 : location.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((nodeId == null) ? 0 : nodeId.hashCode());
result = prime * result + ((streetName == null) ? 0 : streetName.hashCode());
return result;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
NodeHouseNumber other = (NodeHouseNumber) obj;
if (houseNumber == null) {
if (other.houseNumber != null)
return false;
} else if (!houseNumber.equals(other.houseNumber))
return false;
if (location == null) {
if (other.location != null)
return false;
} else if (!location.equals(other.location))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (nodeId == null) {
if (other.nodeId != null)
return false;
} else if (!nodeId.equals(other.nodeId))
return false;
if (streetName == null) {
if (other.streetName != null)
return false;
} else if (!streetName.equals(other.streetName))
return false;
return true;
}
}