1 //
2 // SearchedItem.java
3 // CocoDonkey
4 // $Id: SearchedItem.java,v 1.3 2002/07/22 00:30:22 fortun Exp $
5 //
6 // Created by Fred Bonzoun on Sun May 12 2002.
7 // Copyright (c) 2002 Bonzoun. All rights reserved.
8 //
9 // This library is free software; you can redistribute it and/or modify
10 // it under the terms of the GNU Lesser General Public License as published
11 // by the Free Software Foundation; either version 2.1 of the License, or
12 // (at your option) any later version.
13 //
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 //
23
24 package net.bonzoun.cocodonkey;
25
26 import com.apple.cocoa.foundation;
27 import java.util;
28
29 public class SearchedItem extends GenericItem {
30
31 public String type;
32 public String extension;
33 public String codec;
34 public String length;
35
36 private List aliases = new ArrayList();
37
38 /*package*/ SearchedItem(int id, String name) {
39 super(id, name);
40 }
41
42 /*package*/ void addAlias(String name) {
43 aliases.add(name);
44 }
45
46 /*package*/ void addBasicInfo(int size, String hash, int nbClients) {
47 this.size = size;
48 this.hash = hash;
49 this.nbClients = nbClients;
50 complete = true;
51 }
52
53 /*package*/ void addExtendedInfo(String type, String extension, String codec, String length) {
54 this.type = (type==null || type.length()==0 ? null : type);
55 this.extension = (extension==null || extension.length()==0 ? null : extension);
56 this.codec = codec;
57 this.length = length;
58 }
59
60 public String type() {
61 return type;
62 }
63
64 public String extension() {
65 return extension;
66 }
67
68 public String codec() {
69 return codec;
70 }
71
72 public String length() {
73 return length;
74 }
75
76 public List aliases() {
77 return aliases;
78 }
79 }
80
81 // $Log: SearchedItem.java,v $
82 // Revision 1.3 2002/07/22 00:30:22 fortun
83 // NSArrays are now Lists
84 //
85 // Revision 1.2 2002/07/21 15:15:53 fortun
86 // Potential bug corrected
87 //
88 // Revision 1.1.1.1 2002/05/21 21:26:13 fortun
89 //
90 //