001/** 002 * Copyright 2014 Tampere University of Technology, Pori Department 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package service.tut.pori.contentanalysis; 017 018import javax.xml.bind.annotation.XmlAccessType; 019import javax.xml.bind.annotation.XmlAccessorType; 020import javax.xml.bind.annotation.XmlElement; 021import javax.xml.bind.annotation.XmlRootElement; 022 023 024/** 025 * A simple class that shows details about a search query. 026 * Generally used with lists to indicate the total number of results in case the list itself contains only a partial set of results. 027 * 028 * ResultInfo should not be present, if not especially requested with data group {@value service.tut.pori.contentanalysis.Definitions#DATA_GROUP_RESULT_INFO} 029 * 030 * <h2>Optional Elements</h2> 031 * <ul> 032 * <li>{@value service.tut.pori.contentanalysis.Definitions#ELEMENT_START_ITEM}. The requested start item, if available.</li> 033 * <li>{@value service.tut.pori.contentanalysis.Definitions#ELEMENT_END_ITEM}. The requested end item, if available.</li> 034 * </ul> 035 * 036 * <h3>XML Example</h3> 037 * 038 * {@doc.restlet service="[service.tut.pori.contentanalysis.reference.Definitions#SERVICE_CA_REFERENCE_EXAMPLE]" method="[service.tut.pori.contentanalysis.Definitions#ELEMENT_RESULT_INFO]" type="GET" query="" body_uri=""} 039 * 040 */ 041@XmlRootElement(name=Definitions.ELEMENT_RESULT_INFO) 042@XmlAccessorType(XmlAccessType.NONE) 043public class ResultInfo { 044 @XmlElement(name = Definitions.ELEMENT_END_ITEM) 045 private Long _endItem = null; 046 @XmlElement(name = Definitions.ELEMENT_RESULT_COUNT) 047 private Long _resultCount = null; 048 @XmlElement(name = Definitions.ELEMENT_START_ITEM) 049 private Long _startItem = null; 050 051 /** 052 * for serialization 053 */ 054 public ResultInfo(){ 055 // nothing needed 056 } 057 058 /** 059 * 060 * @param startItem 061 * @param endItem 062 * @param resultCount 063 */ 064 public ResultInfo(long startItem, long endItem, long resultCount){ 065 _startItem = startItem; 066 _endItem = endItem; 067 _resultCount = resultCount; 068 } 069 070 /** 071 * The total number of results for the request. Note that in some cases this may only be an estimate. 072 * 073 * @return number of results 074 * @see #setResultCount(Long) 075 */ 076 public Long getResultCount() { 077 return _resultCount; 078 } 079 080 /** 081 * 082 * @param resultCount 083 * @see #getResultCount() 084 */ 085 public void setResultCount(Long resultCount){ 086 _resultCount = resultCount; 087 } 088 089 /** 090 * @return the endItem 091 */ 092 public Long getEndItem() { 093 return _endItem; 094 } 095 096 /** 097 * @param endItem the endItem to set 098 */ 099 public void setEndItem(Long endItem) { 100 _endItem = endItem; 101 } 102 103 /** 104 * @return the startItem 105 */ 106 public Long getStartItem() { 107 return _startItem; 108 } 109 110 /** 111 * @param startItem the startItem to set 112 */ 113 public void setStartItem(Long startItem) { 114 _startItem = startItem; 115 } 116}