Code example for Timestamp

Methods: getTime

0
	private Publication cursorToPublication(Cursor cursor){
		Publication pub = new Publication();
		pub.setId(cursor.getLong(0));
		pub.setTitle(cursor.getString(1));
		pub.setAbstract(cursor.getString(2));
		Timestamp timestamp = new Timestamp(cursor.getLong(3));
		pub.setLastModified(new Date(timestamp.getTime()));
		 
		return pub;
	} 
	 
	/** 
	 * Returns all the publications that match the search query 
	 * @param query to search about 
	 * @return list of publications that are results of the search 
	 */ 
	public List<Publication> search(String query){
		List<Publication> results = new ArrayList<Publication>();
		 
		String lowerQuery = query.toLowerCase();
		String convertedQuery = "%"+lowerQuery.toLowerCase()+"%";