source: other-projects/trunk/greenstone3-extension/mat/src/org/greenstone/gsdl3_extension/mat/MetadataElement.java@ 18000

Last change on this file since 18000 was 18000, checked in by cc108, 15 years ago

new source code

File size: 1.6 KB
Line 
1package org.greenstone.gsdl3_extension.mat;
2
3import java.util.ArrayList;
4import java.util.Arrays;
5import java.util.Collection;
6import java.util.HashMap;
7import java.util.Iterator;
8
9
10
11public class MetadataElement {
12
13 protected String metadataName = null;;
14 protected int frequency = 0;
15 protected ArrayList length = new ArrayList();
16 protected HashMap metadataList= new HashMap();
17 protected boolean used = false;
18 protected HashMap valueList = new HashMap();
19
20 public String getMetadataName(){
21 return this.metadataName;
22 }
23
24 public HashMap getValueList(){
25 return valueList;
26 }
27
28 public int getFrequency(){
29 return frequency;
30 }
31
32 public ArrayList getLength(){
33 return length;
34 }
35
36 public HashMap getMetadataList(){
37 return metadataList;
38 }
39
40 public void setMetadataName(String Meta_Name){
41 metadataName = Meta_Name;
42 }
43
44 public void IncreaseFrequency(){
45 frequency++;
46 }
47
48 public void DecreaseFrequency(){
49 frequency--;
50 }
51
52 public void SetLengthList(int len){
53 Integer in = new Integer (len);
54 length.add(in);
55 }
56
57 public void SetmetadataList(String ID, DocumentInfo doc){
58 metadataList.put(ID, doc);
59 }
60
61 public void SetStatus(boolean status){
62 used = status;
63 }
64
65 public int[] sortArrayList(){
66
67 int[] sortList = new int [metadataList.size()];
68 Collection c = metadataList.values();
69 Iterator i = c.iterator();
70 int x = 0;
71
72 while(i.hasNext()){
73 sortList[x] = ((DocumentInfo) i.next()).getFrequence();
74 x++;
75 }
76
77 Arrays.sort(sortList);
78 return sortList;
79 }
80}
Note: See TracBrowser for help on using the repository browser.