1 package net.obsearch.pivots; 2 3 import java.util.List; 4 5 import net.obsearch.OB; 6 import net.obsearch.utils.Pair; 7 8 /* 9 OBSearch: a distributed similarity search engine This project is to 10 similarity search what 'bit-torrent' is to downloads. 11 Copyright (C) 2008 Arnoldo Jose Muller Molina 12 13 This program is free software: you can redistribute it and/or modify 14 it under the terms of the GNU General Public License as published by 15 the Free Software Foundation, either version 3 of the License, or 16 (at your option) any later version. 17 18 This program is distributed in the hope that it will be useful, 19 but WITHOUT ANY WARRANTY; without even the implied warranty of 20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 GNU General Public License for more details. 22 23 You should have received a copy of the GNU General Public License 24 along with this program. If not, see <http://www.gnu.org/licenses/>. 25 */ 26 27 /** 28 * PivotResult returns a set of pivots selected from the database. 29 * 30 * @author Arnoldo Jose Muller Molina 31 */ 32 33 public class PivotResult { 34 35 36 /** 37 * Pivot ids extracted from the DB. 38 */ 39 private long [] pivotIds; 40 41 public PivotResult(){ 42 43 } 44 /** 45 * Construct a pivotResult form a set of pivotIds. 46 * @param pivotIds 47 */ 48 public PivotResult(long[] pivotIds) { 49 super(); 50 this.pivotIds = pivotIds; 51 } 52 53 public PivotResult(List<Pair<Long,OB>> pivotIds) { 54 this.pivotIds = new long[pivotIds.size()]; 55 int i = 0; 56 for(Pair<Long,OB> p : pivotIds){ 57 this.pivotIds[i] = p.getA(); 58 i++; 59 } 60 } 61 62 /** 63 * Returns 64 * @return 65 */ 66 public long [] getPivotIds(){ 67 return pivotIds; 68 } 69 70 }