KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > search > extractors > CmsExtractionResult


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/search/extractors/CmsExtractionResult.java,v $
3  * Date : $Date: 2005/07/29 12:13:00 $
4  * Version: $Revision: 1.5 $
5  *
6  * This library is part of OpenCms -
7  * the Open Source Content Mananagement System
8  *
9  * Copyright (c) 2005 Alkacon Software GmbH (http://www.alkacon.com)
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * For further information about Alkacon Software GmbH, please see the
22  * company website: http://www.alkacon.com
23  *
24  * For further information about OpenCms, please see the
25  * project website: http://www.opencms.org
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this library; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */

31
32 package org.opencms.search.extractors;
33
34 import java.util.Collections JavaDoc;
35 import java.util.Map JavaDoc;
36
37 /**
38  * The result of a document text extraction.<p>
39  *
40  * This data structure contains the extracted text as well as (optional)
41  * meta information extracted from the document.<p>
42  *
43  * @author Alexander Kandzior
44  *
45  * @version $Revision: 1.5 $
46  *
47  * @since 6.0.0
48  */

49 public class CmsExtractionResult implements I_CmsExtractionResult {
50
51     /** The extracted content. */
52     private String JavaDoc m_content;
53
54     /** The extracted meta information. */
55     private Map JavaDoc m_metaInfo;
56
57     /**
58      * Creates a new extration result without meta information.<p>
59      *
60      * @param content the extracted content
61      */

62     public CmsExtractionResult(String JavaDoc content) {
63
64         this(content, null);
65     }
66
67     /**
68      * Creates a new extration result.<p>
69      *
70      * @param content the extracted content
71      * @param metaInfo the extracted documnet meta information
72      */

73     public CmsExtractionResult(String JavaDoc content, Map JavaDoc metaInfo) {
74
75         m_content = content;
76         m_metaInfo = metaInfo;
77
78         if (m_metaInfo == null) {
79             m_metaInfo = Collections.EMPTY_MAP;
80         }
81     }
82
83     /**
84      * @see org.opencms.search.extractors.I_CmsExtractionResult#getContent()
85      */

86     public String JavaDoc getContent() {
87
88         return m_content;
89     }
90
91     /**
92      * @see org.opencms.search.extractors.I_CmsExtractionResult#getMetaInfo()
93      */

94     public Map JavaDoc getMetaInfo() {
95
96         return m_metaInfo;
97     }
98
99     /**
100      * @see org.opencms.search.extractors.I_CmsExtractionResult#release()
101      */

102     public void release() {
103
104         if (!m_metaInfo.isEmpty()) {
105             m_metaInfo.clear();
106         }
107         m_metaInfo = null;
108         m_content = null;
109     }
110 }
Popular Tags