root / src / gr / grnet / pithos / web / client / tagtree / Tag.java @ ea30dad9
History | View | Annotate | Download (2.5 kB)
1 | a6592a15 | Christos Stathis | /*
|
---|---|---|---|
2 | cae2a8db | Christos Stathis | * Copyright 2011-2012 GRNET S.A. All rights reserved.
|
3 | a6592a15 | Christos Stathis | *
|
4 | a6592a15 | Christos Stathis | * Redistribution and use in source and binary forms, with or
|
5 | a6592a15 | Christos Stathis | * without modification, are permitted provided that the following
|
6 | a6592a15 | Christos Stathis | * conditions are met:
|
7 | a6592a15 | Christos Stathis | *
|
8 | a6592a15 | Christos Stathis | * 1. Redistributions of source code must retain the above
|
9 | a6592a15 | Christos Stathis | * copyright notice, this list of conditions and the following
|
10 | a6592a15 | Christos Stathis | * disclaimer.
|
11 | a6592a15 | Christos Stathis | *
|
12 | a6592a15 | Christos Stathis | * 2. Redistributions in binary form must reproduce the above
|
13 | a6592a15 | Christos Stathis | * copyright notice, this list of conditions and the following
|
14 | a6592a15 | Christos Stathis | * disclaimer in the documentation and/or other materials
|
15 | a6592a15 | Christos Stathis | * provided with the distribution.
|
16 | a6592a15 | Christos Stathis | *
|
17 | a6592a15 | Christos Stathis | * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
|
18 | a6592a15 | Christos Stathis | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
19 | a6592a15 | Christos Stathis | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
20 | a6592a15 | Christos Stathis | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
|
21 | a6592a15 | Christos Stathis | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
22 | a6592a15 | Christos Stathis | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
23 | a6592a15 | Christos Stathis | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
24 | a6592a15 | Christos Stathis | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
25 | a6592a15 | Christos Stathis | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
26 | a6592a15 | Christos Stathis | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
27 | a6592a15 | Christos Stathis | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
28 | a6592a15 | Christos Stathis | * POSSIBILITY OF SUCH DAMAGE.
|
29 | a6592a15 | Christos Stathis | *
|
30 | a6592a15 | Christos Stathis | * The views and conclusions contained in the software and
|
31 | a6592a15 | Christos Stathis | * documentation are those of the authors and should not be
|
32 | a6592a15 | Christos Stathis | * interpreted as representing official policies, either expressed
|
33 | a6592a15 | Christos Stathis | * or implied, of GRNET S.A.
|
34 | a6592a15 | Christos Stathis | */
|
35 | a6592a15 | Christos Stathis | |
36 | a6592a15 | Christos Stathis | package gr.grnet.pithos.web.client.tagtree; |
37 | a6592a15 | Christos Stathis | |
38 | a6592a15 | Christos Stathis | import gr.grnet.pithos.web.client.foldertree.File; |
39 | a6592a15 | Christos Stathis | import gr.grnet.pithos.web.client.foldertree.Resource; |
40 | 7811b9d1 | Christos Stathis | |
41 | f5023f13 | Christos Stathis | import java.util.Date; |
42 | a6592a15 | Christos Stathis | import java.util.LinkedHashSet; |
43 | a6592a15 | Christos Stathis | import java.util.Set; |
44 | a6592a15 | Christos Stathis | |
45 | a6592a15 | Christos Stathis | public class Tag extends Resource { |
46 | a6592a15 | Christos Stathis | /*
|
47 | a6592a15 | Christos Stathis | * The name of the tag.
|
48 | a6592a15 | Christos Stathis | */
|
49 | a6592a15 | Christos Stathis | private String name = null; |
50 | a6592a15 | Christos Stathis | |
51 | a6592a15 | Christos Stathis | private Set<File> files = new LinkedHashSet<File>(); |
52 | a6592a15 | Christos Stathis | |
53 | a6592a15 | Christos Stathis | public Tag() {};
|
54 | a6592a15 | Christos Stathis | |
55 | a6592a15 | Christos Stathis | public Tag(String name) { |
56 | a6592a15 | Christos Stathis | this.name = name;
|
57 | a6592a15 | Christos Stathis | } |
58 | a6592a15 | Christos Stathis | |
59 | a6592a15 | Christos Stathis | public String getName() { |
60 | a6592a15 | Christos Stathis | return name;
|
61 | a6592a15 | Christos Stathis | } |
62 | a6592a15 | Christos Stathis | |
63 | a6592a15 | Christos Stathis | @Override
|
64 | a6592a15 | Christos Stathis | public boolean equals(Object other) { |
65 | a6592a15 | Christos Stathis | if (other instanceof Tag) { |
66 | a6592a15 | Christos Stathis | Tag o = (Tag) other; |
67 | a6592a15 | Christos Stathis | return name.equals(o.getName());
|
68 | a6592a15 | Christos Stathis | } |
69 | a6592a15 | Christos Stathis | return false; |
70 | a6592a15 | Christos Stathis | } |
71 | a6592a15 | Christos Stathis | |
72 | a6592a15 | Christos Stathis | @Override
|
73 | a6592a15 | Christos Stathis | public int hashCode() { |
74 | a6592a15 | Christos Stathis | return name.hashCode();
|
75 | a6592a15 | Christos Stathis | } |
76 | a6592a15 | Christos Stathis | |
77 | a6592a15 | Christos Stathis | public Set<File> getFiles() { |
78 | a6592a15 | Christos Stathis | return files;
|
79 | a6592a15 | Christos Stathis | } |
80 | f5023f13 | Christos Stathis | |
81 | f5023f13 | Christos Stathis | @Override
|
82 | f5023f13 | Christos Stathis | public Date getLastModified() { |
83 | f5023f13 | Christos Stathis | return null; |
84 | f5023f13 | Christos Stathis | } |
85 | a6592a15 | Christos Stathis | } |