lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r712922 [6/9] - in /lucene/java/trunk: contrib/analyzers/src/java/org/apache/lucene/analysis/el/ contrib/analyzers/src/java/org/apache/lucene/analysis/fr/ contrib/analyzers/src/java/org/apache/lucene/analysis/miscellaneous/ contrib/analyzer...
Date Tue, 11 Nov 2008 02:35:52 GMT
Modified: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/DataStore.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/DataStore.java?rev=712922&r1=712921&r2=712922&view=diff
==============================================================================
--- lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/DataStore.java (original)
+++ lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/DataStore.java Mon Nov 10 18:35:46 2008
@@ -1,202 +1,202 @@
-package org.apache.lucene.swing.models;
-
-
-/**
- * Copyright 2005 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-
-public class DataStore {
-
-    private static final String ITALIAN_CATEGORY = "Italian";
-    private static final String CUBAN_CATEGORY = "Cuban";
-    private static final String STEAK_CATEGORY = "Steak";
-    private static int id = 0;
-
-    static Collection restaurants = new ArrayList();
-    static RestaurantInfo pinos = new RestaurantInfo();
-    static RestaurantInfo canolis = new RestaurantInfo();
-    static RestaurantInfo picadillo = new RestaurantInfo();
-    static RestaurantInfo versailles = new RestaurantInfo();
-    static RestaurantInfo laCaretta = new RestaurantInfo();
-    static RestaurantInfo laCaretta2 = new RestaurantInfo();
-    static RestaurantInfo laCaretta3 = new RestaurantInfo();
-    static RestaurantInfo ranchaLuna = new RestaurantInfo();
-    static RestaurantInfo leMerais = new RestaurantInfo();
-    static RestaurantInfo chris = new RestaurantInfo();
-    static RestaurantInfo outback = new RestaurantInfo();
-    static RestaurantInfo outback2 = new RestaurantInfo();
-    static RestaurantInfo outback3 = new RestaurantInfo();
-    static RestaurantInfo outback4 = new RestaurantInfo();
-
-
-    public static Iterator getRestaurants(){
-        return restaurants.iterator();
-    }
-
-    static {
-        pinos.setId(getNextId());
-        pinos.setType(ITALIAN_CATEGORY);
-        pinos.setName("Pino's");
-        pinos.setPhone("(305) 111-2222");
-        pinos.setStreet("12115 105th Street ");
-        pinos.setCity("Miami");
-        pinos.setState("FL");
-        pinos.setZip("33176");
-        restaurants.add(pinos);
-
-        canolis.setId(getNextId());
-        canolis.setType(ITALIAN_CATEGORY);
-        canolis.setName("Canoli's");
-        canolis.setPhone("(305) 234-5543");
-        canolis.setStreet("12123 85th Street ");
-        canolis.setCity("Miami");
-        canolis.setState("FL");
-        canolis.setZip("33176");
-        restaurants.add(canolis);
-
-        picadillo.setId(getNextId());
-        picadillo.setType(CUBAN_CATEGORY);
-        picadillo.setName("Picadillo");
-        picadillo.setPhone("(305) 746-7865");
-        picadillo.setStreet("109 12th Street ");
-        picadillo.setCity("Miami");
-        picadillo.setState("FL");
-        picadillo.setZip("33176");
-        restaurants.add(picadillo);
-
-        versailles.setId(getNextId());
-        versailles.setType(CUBAN_CATEGORY);
-        versailles.setName("Cafe Versailles");
-        versailles.setPhone("(305) 201-5438");
-        versailles.setStreet("312 8th Street ");
-        versailles.setCity("Miami");
-        versailles.setState("FL");
-        versailles.setZip("33176");
-        restaurants.add(versailles);
-
-        laCaretta.setId(getNextId());
-        laCaretta.setType(CUBAN_CATEGORY);
-        laCaretta.setName("La Carretta");
-        laCaretta.setPhone("(305) 342-9876");
-        laCaretta.setStreet("348 8th Street ");
-        laCaretta.setCity("Miami");
-        laCaretta.setState("FL");
-        laCaretta.setZip("33176");
-        restaurants.add(laCaretta);
-
-        laCaretta2.setId(getNextId());
-        laCaretta2.setType(CUBAN_CATEGORY);
-        laCaretta2.setName("La Carretta");
-        laCaretta2.setPhone("(305) 556-9876");
-        laCaretta2.setStreet("31224 23rd Street ");
-        laCaretta2.setCity("Miami");
-        laCaretta2.setState("FL");
-        laCaretta2.setZip("33176");
-        restaurants.add(laCaretta2);
-
-        laCaretta3.setId(getNextId());
-        laCaretta3.setType(CUBAN_CATEGORY);
-        laCaretta3.setName("La Carretta");
-        laCaretta3.setPhone("(305) 682-9876");
-        laCaretta3.setStreet("23543 107th Street ");
-        laCaretta3.setCity("Miami");
-        laCaretta3.setState("FL");
-        laCaretta3.setZip("33176");
-        restaurants.add(laCaretta3);
-
-        ranchaLuna.setId(getNextId());
-        ranchaLuna.setType(CUBAN_CATEGORY);
-        ranchaLuna.setName("Rancha Luna");
-        ranchaLuna.setPhone("(305) 777-4384");
-        ranchaLuna.setStreet("110 23rd Street ");
-        ranchaLuna.setCity("Miami");
-        ranchaLuna.setState("FL");
-        ranchaLuna.setZip("33176");
-        restaurants.add(ranchaLuna);
-
-        leMerais.setId(getNextId());
-        leMerais.setType(STEAK_CATEGORY);
-        leMerais.setName("Le Merais");
-        leMerais.setPhone("(212) 654-9187");
-        leMerais.setStreet("11 West 46th Street");
-        leMerais.setCity("New York");
-        leMerais.setState("NY");
-        leMerais.setZip("10018");
-        restaurants.add(leMerais);
-
-        chris.setId(getNextId());
-        chris.setType(STEAK_CATEGORY);
-        chris.setName("Ruth's Chris Seakhouse");
-        chris.setPhone("(305) 354-8885");
-        chris.setStreet("12365 203rd Street ");
-        chris.setCity("Miami");
-        chris.setState("FL");
-        chris.setZip("33176");
-        restaurants.add(chris);
-
-        outback.setId(getNextId());
-        outback.setType(STEAK_CATEGORY);
-        outback.setName("Outback");
-        outback.setPhone("(305) 244-7623");
-        outback.setStreet("348 136th Street ");
-        outback.setCity("Miami");
-        outback.setState("FL");
-        outback.setZip("33176");
-        restaurants.add(outback);
-
-        outback2.setId(getNextId());
-        outback2.setType(STEAK_CATEGORY);
-        outback2.setName("Outback");
-        outback2.setPhone("(305) 533-6522");
-        outback2.setStreet("21 207th Street ");
-        outback2.setCity("Miami");
-        outback2.setState("FL");
-        outback2.setZip("33176");
-        restaurants.add(outback2);
-
-        outback3.setId(getNextId());
-        outback3.setType(STEAK_CATEGORY);
-        outback3.setName("Outback");
-        outback3.setPhone("(305) 244-7623");
-        outback3.setStreet("10117 107th Street ");
-        outback3.setCity("Miami");
-        outback3.setState("FL");
-        outback3.setZip("33176");
-        restaurants.add(outback3);
-
-        outback4.setId(getNextId());
-        outback4.setType(STEAK_CATEGORY);
-        outback4.setName("Outback");
-        outback4.setPhone("(954) 221-3312");
-        outback4.setStreet("10 11th Street ");
-        outback4.setCity("Aventura");
-        outback4.setState("FL");
-        outback4.setZip("32154");
-        restaurants.add(outback4);
-
-    }
-
-    private static int getNextId(){
-        id++;
-        return id;
-    }
-
-}
+package org.apache.lucene.swing.models;
+
+
+/**
+ * Copyright 2005 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+
+public class DataStore {
+
+    private static final String ITALIAN_CATEGORY = "Italian";
+    private static final String CUBAN_CATEGORY = "Cuban";
+    private static final String STEAK_CATEGORY = "Steak";
+    private static int id = 0;
+
+    static Collection restaurants = new ArrayList();
+    static RestaurantInfo pinos = new RestaurantInfo();
+    static RestaurantInfo canolis = new RestaurantInfo();
+    static RestaurantInfo picadillo = new RestaurantInfo();
+    static RestaurantInfo versailles = new RestaurantInfo();
+    static RestaurantInfo laCaretta = new RestaurantInfo();
+    static RestaurantInfo laCaretta2 = new RestaurantInfo();
+    static RestaurantInfo laCaretta3 = new RestaurantInfo();
+    static RestaurantInfo ranchaLuna = new RestaurantInfo();
+    static RestaurantInfo leMerais = new RestaurantInfo();
+    static RestaurantInfo chris = new RestaurantInfo();
+    static RestaurantInfo outback = new RestaurantInfo();
+    static RestaurantInfo outback2 = new RestaurantInfo();
+    static RestaurantInfo outback3 = new RestaurantInfo();
+    static RestaurantInfo outback4 = new RestaurantInfo();
+
+
+    public static Iterator getRestaurants(){
+        return restaurants.iterator();
+    }
+
+    static {
+        pinos.setId(getNextId());
+        pinos.setType(ITALIAN_CATEGORY);
+        pinos.setName("Pino's");
+        pinos.setPhone("(305) 111-2222");
+        pinos.setStreet("12115 105th Street ");
+        pinos.setCity("Miami");
+        pinos.setState("FL");
+        pinos.setZip("33176");
+        restaurants.add(pinos);
+
+        canolis.setId(getNextId());
+        canolis.setType(ITALIAN_CATEGORY);
+        canolis.setName("Canoli's");
+        canolis.setPhone("(305) 234-5543");
+        canolis.setStreet("12123 85th Street ");
+        canolis.setCity("Miami");
+        canolis.setState("FL");
+        canolis.setZip("33176");
+        restaurants.add(canolis);
+
+        picadillo.setId(getNextId());
+        picadillo.setType(CUBAN_CATEGORY);
+        picadillo.setName("Picadillo");
+        picadillo.setPhone("(305) 746-7865");
+        picadillo.setStreet("109 12th Street ");
+        picadillo.setCity("Miami");
+        picadillo.setState("FL");
+        picadillo.setZip("33176");
+        restaurants.add(picadillo);
+
+        versailles.setId(getNextId());
+        versailles.setType(CUBAN_CATEGORY);
+        versailles.setName("Cafe Versailles");
+        versailles.setPhone("(305) 201-5438");
+        versailles.setStreet("312 8th Street ");
+        versailles.setCity("Miami");
+        versailles.setState("FL");
+        versailles.setZip("33176");
+        restaurants.add(versailles);
+
+        laCaretta.setId(getNextId());
+        laCaretta.setType(CUBAN_CATEGORY);
+        laCaretta.setName("La Carretta");
+        laCaretta.setPhone("(305) 342-9876");
+        laCaretta.setStreet("348 8th Street ");
+        laCaretta.setCity("Miami");
+        laCaretta.setState("FL");
+        laCaretta.setZip("33176");
+        restaurants.add(laCaretta);
+
+        laCaretta2.setId(getNextId());
+        laCaretta2.setType(CUBAN_CATEGORY);
+        laCaretta2.setName("La Carretta");
+        laCaretta2.setPhone("(305) 556-9876");
+        laCaretta2.setStreet("31224 23rd Street ");
+        laCaretta2.setCity("Miami");
+        laCaretta2.setState("FL");
+        laCaretta2.setZip("33176");
+        restaurants.add(laCaretta2);
+
+        laCaretta3.setId(getNextId());
+        laCaretta3.setType(CUBAN_CATEGORY);
+        laCaretta3.setName("La Carretta");
+        laCaretta3.setPhone("(305) 682-9876");
+        laCaretta3.setStreet("23543 107th Street ");
+        laCaretta3.setCity("Miami");
+        laCaretta3.setState("FL");
+        laCaretta3.setZip("33176");
+        restaurants.add(laCaretta3);
+
+        ranchaLuna.setId(getNextId());
+        ranchaLuna.setType(CUBAN_CATEGORY);
+        ranchaLuna.setName("Rancha Luna");
+        ranchaLuna.setPhone("(305) 777-4384");
+        ranchaLuna.setStreet("110 23rd Street ");
+        ranchaLuna.setCity("Miami");
+        ranchaLuna.setState("FL");
+        ranchaLuna.setZip("33176");
+        restaurants.add(ranchaLuna);
+
+        leMerais.setId(getNextId());
+        leMerais.setType(STEAK_CATEGORY);
+        leMerais.setName("Le Merais");
+        leMerais.setPhone("(212) 654-9187");
+        leMerais.setStreet("11 West 46th Street");
+        leMerais.setCity("New York");
+        leMerais.setState("NY");
+        leMerais.setZip("10018");
+        restaurants.add(leMerais);
+
+        chris.setId(getNextId());
+        chris.setType(STEAK_CATEGORY);
+        chris.setName("Ruth's Chris Seakhouse");
+        chris.setPhone("(305) 354-8885");
+        chris.setStreet("12365 203rd Street ");
+        chris.setCity("Miami");
+        chris.setState("FL");
+        chris.setZip("33176");
+        restaurants.add(chris);
+
+        outback.setId(getNextId());
+        outback.setType(STEAK_CATEGORY);
+        outback.setName("Outback");
+        outback.setPhone("(305) 244-7623");
+        outback.setStreet("348 136th Street ");
+        outback.setCity("Miami");
+        outback.setState("FL");
+        outback.setZip("33176");
+        restaurants.add(outback);
+
+        outback2.setId(getNextId());
+        outback2.setType(STEAK_CATEGORY);
+        outback2.setName("Outback");
+        outback2.setPhone("(305) 533-6522");
+        outback2.setStreet("21 207th Street ");
+        outback2.setCity("Miami");
+        outback2.setState("FL");
+        outback2.setZip("33176");
+        restaurants.add(outback2);
+
+        outback3.setId(getNextId());
+        outback3.setType(STEAK_CATEGORY);
+        outback3.setName("Outback");
+        outback3.setPhone("(305) 244-7623");
+        outback3.setStreet("10117 107th Street ");
+        outback3.setCity("Miami");
+        outback3.setState("FL");
+        outback3.setZip("33176");
+        restaurants.add(outback3);
+
+        outback4.setId(getNextId());
+        outback4.setType(STEAK_CATEGORY);
+        outback4.setName("Outback");
+        outback4.setPhone("(954) 221-3312");
+        outback4.setStreet("10 11th Street ");
+        outback4.setCity("Aventura");
+        outback4.setState("FL");
+        outback4.setZip("32154");
+        restaurants.add(outback4);
+
+    }
+
+    private static int getNextId(){
+        id++;
+        return id;
+    }
+
+}

Propchange: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/DataStore.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/ListSearcherSimulator.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/ListSearcherSimulator.java?rev=712922&r1=712921&r2=712922&view=diff
==============================================================================
--- lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/ListSearcherSimulator.java (original)
+++ lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/ListSearcherSimulator.java Mon Nov 10 18:35:46 2008
@@ -1,88 +1,88 @@
-package org.apache.lucene.swing.models;
-
-/**
- * Copyright 2005 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.awt.BorderLayout;
-
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-
-
-public class ListSearcherSimulator {
-
-    public ListSearcherSimulator() {
-        JFrame frame = new JFrame();
-        frame.setBounds(200,200, 400,250);
-
-        JList list = new JList();
-        JScrollPane scrollPane = new JScrollPane(list);
-
-        final BaseListModel listModel = new BaseListModel(DataStore.getRestaurants());
-        final ListSearcher listSearcher = new ListSearcher(listModel);
-
-        list.setModel(listSearcher);
-
-        final JTextField searchField = new JTextField();
-        searchField.getDocument().addDocumentListener(
-                new DocumentListener(){
-                    public void changedUpdate(DocumentEvent e) {
-                        listSearcher.search(searchField.getText().trim().toLowerCase());
-                    }
-
-                    public void insertUpdate(DocumentEvent e) {
-                        listSearcher.search(searchField.getText().trim().toLowerCase());
-                    }
-
-                    public void removeUpdate(DocumentEvent e) {
-                        listSearcher.search(searchField.getText().trim().toLowerCase());
-                    }
-                }
-        );
-
-        frame.getContentPane().setLayout(new BorderLayout());
-        frame.getContentPane().add(scrollPane, BorderLayout.CENTER);
-
-        JPanel searchPanel = new JPanel();
-        searchPanel.setLayout(new BorderLayout(10,10));
-        searchPanel.add(searchField, BorderLayout.CENTER);
-        searchPanel.add(new JLabel("Search: "), BorderLayout.WEST);
-
-        JPanel topPanel = new JPanel(new BorderLayout());
-        topPanel.add(searchPanel, BorderLayout.CENTER);
-        topPanel.add(new JPanel(), BorderLayout.EAST);
-        topPanel.add(new JPanel(), BorderLayout.WEST);
-        topPanel.add(new JPanel(), BorderLayout.NORTH);
-        topPanel.add(new JPanel(), BorderLayout.SOUTH);
-
-        frame.getContentPane().add(topPanel, BorderLayout.NORTH);
-
-        frame.setTitle("Lucene powered table searching");
-        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-        frame.show();
-    }
-
-    public static void main(String[] args) {
-        new ListSearcherSimulator();
-    }
-
-}
+package org.apache.lucene.swing.models;
+
+/**
+ * Copyright 2005 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.awt.BorderLayout;
+
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTextField;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+
+
+public class ListSearcherSimulator {
+
+    public ListSearcherSimulator() {
+        JFrame frame = new JFrame();
+        frame.setBounds(200,200, 400,250);
+
+        JList list = new JList();
+        JScrollPane scrollPane = new JScrollPane(list);
+
+        final BaseListModel listModel = new BaseListModel(DataStore.getRestaurants());
+        final ListSearcher listSearcher = new ListSearcher(listModel);
+
+        list.setModel(listSearcher);
+
+        final JTextField searchField = new JTextField();
+        searchField.getDocument().addDocumentListener(
+                new DocumentListener(){
+                    public void changedUpdate(DocumentEvent e) {
+                        listSearcher.search(searchField.getText().trim().toLowerCase());
+                    }
+
+                    public void insertUpdate(DocumentEvent e) {
+                        listSearcher.search(searchField.getText().trim().toLowerCase());
+                    }
+
+                    public void removeUpdate(DocumentEvent e) {
+                        listSearcher.search(searchField.getText().trim().toLowerCase());
+                    }
+                }
+        );
+
+        frame.getContentPane().setLayout(new BorderLayout());
+        frame.getContentPane().add(scrollPane, BorderLayout.CENTER);
+
+        JPanel searchPanel = new JPanel();
+        searchPanel.setLayout(new BorderLayout(10,10));
+        searchPanel.add(searchField, BorderLayout.CENTER);
+        searchPanel.add(new JLabel("Search: "), BorderLayout.WEST);
+
+        JPanel topPanel = new JPanel(new BorderLayout());
+        topPanel.add(searchPanel, BorderLayout.CENTER);
+        topPanel.add(new JPanel(), BorderLayout.EAST);
+        topPanel.add(new JPanel(), BorderLayout.WEST);
+        topPanel.add(new JPanel(), BorderLayout.NORTH);
+        topPanel.add(new JPanel(), BorderLayout.SOUTH);
+
+        frame.getContentPane().add(topPanel, BorderLayout.NORTH);
+
+        frame.setTitle("Lucene powered table searching");
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        frame.show();
+    }
+
+    public static void main(String[] args) {
+        new ListSearcherSimulator();
+    }
+
+}

Propchange: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/ListSearcherSimulator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/RestaurantInfo.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/RestaurantInfo.java?rev=712922&r1=712921&r2=712922&view=diff
==============================================================================
--- lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/RestaurantInfo.java (original)
+++ lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/RestaurantInfo.java Mon Nov 10 18:35:46 2008
@@ -1,100 +1,100 @@
-package org.apache.lucene.swing.models;
-
-/**
- * Copyright 2005 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-public class RestaurantInfo {
-    private int id;
-    private String name;
-
-    private String type;
-
-    private String phone;
-    private String street;
-    private String city;
-    private String state;
-    private String zip;
-
-    public int getId() {
-        return id;
-    }
-
-    public void setId(int id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getPhone() {
-        return phone;
-    }
-
-    public void setPhone(String phone) {
-        this.phone = phone;
-    }
-
-    public String getStreet() {
-        return street;
-    }
-
-    public void setStreet(String street) {
-        this.street = street;
-    }
-
-    public String getCity() {
-        return city;
-    }
-
-    public void setCity(String city) {
-        this.city = city;
-    }
-
-    public String getState() {
-        return state;
-    }
-
-    public void setState(String state) {
-        this.state = state;
-    }
-
-    public String getZip() {
-        return zip;
-    }
-
-    public void setZip(String zip) {
-        this.zip = zip;
-    }
-
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public String toString() {
-        return getName() + " - " + getPhone();
-    }
-
-}
+package org.apache.lucene.swing.models;
+
+/**
+ * Copyright 2005 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+public class RestaurantInfo {
+    private int id;
+    private String name;
+
+    private String type;
+
+    private String phone;
+    private String street;
+    private String city;
+    private String state;
+    private String zip;
+
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getStreet() {
+        return street;
+    }
+
+    public void setStreet(String street) {
+        this.street = street;
+    }
+
+    public String getCity() {
+        return city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getZip() {
+        return zip;
+    }
+
+    public void setZip(String zip) {
+        this.zip = zip;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String toString() {
+        return getName() + " - " + getPhone();
+    }
+
+}

Propchange: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/RestaurantInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TableSearcherSimulator.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TableSearcherSimulator.java?rev=712922&r1=712921&r2=712922&view=diff
==============================================================================
--- lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TableSearcherSimulator.java (original)
+++ lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TableSearcherSimulator.java Mon Nov 10 18:35:46 2008
@@ -1,81 +1,81 @@
-package org.apache.lucene.swing.models;
-
-/**
- * Copyright 2005 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.ActionListener;
-import java.awt.event.ActionEvent;
-
-
-public class TableSearcherSimulator {
-
-    public TableSearcherSimulator() {
-        JFrame frame = new JFrame();
-        frame.setBounds(200,200, 400,250);
-
-        JTable table = new JTable();
-        final BaseTableModel tableModel = new BaseTableModel(DataStore.getRestaurants());
-        final TableSearcher searchTableModel = new TableSearcher(tableModel);
-
-        table.setModel(searchTableModel);
-        JScrollPane scrollPane = new JScrollPane(table);
-
-        final JTextField searchField = new JTextField();
-        JButton searchButton = new JButton("Go");
-
-        ActionListener searchListener = new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-               searchTableModel.search(searchField.getText().trim().toLowerCase());
-                searchField.requestFocus();
-            }
-        };
-
-        searchButton.addActionListener(searchListener);
-        searchField.addActionListener(searchListener);
-
-
-
-        frame.getContentPane().setLayout(new BorderLayout());
-        frame.getContentPane().add(scrollPane, BorderLayout.CENTER);
-
-        JPanel searchPanel = new JPanel();
-        searchPanel.setLayout(new BorderLayout(10,10));
-        searchPanel.add(searchField, BorderLayout.CENTER);
-        searchPanel.add(searchButton, BorderLayout.EAST);
-
-        JPanel topPanel = new JPanel(new BorderLayout());
-        topPanel.add(searchPanel, BorderLayout.CENTER);
-        topPanel.add(new JPanel(), BorderLayout.EAST);
-        topPanel.add(new JPanel(), BorderLayout.WEST);
-        topPanel.add(new JPanel(), BorderLayout.NORTH);
-        topPanel.add(new JPanel(), BorderLayout.SOUTH);
-
-        frame.getContentPane().add(topPanel, BorderLayout.NORTH);
-
-        frame.setTitle("Lucene powered table searching");
-        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-        frame.show();
-
-    }
-
-
-    public static void main(String[] args) {
-        new TableSearcherSimulator();
-    }
-
-}
+package org.apache.lucene.swing.models;
+
+/**
+ * Copyright 2005 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+
+
+public class TableSearcherSimulator {
+
+    public TableSearcherSimulator() {
+        JFrame frame = new JFrame();
+        frame.setBounds(200,200, 400,250);
+
+        JTable table = new JTable();
+        final BaseTableModel tableModel = new BaseTableModel(DataStore.getRestaurants());
+        final TableSearcher searchTableModel = new TableSearcher(tableModel);
+
+        table.setModel(searchTableModel);
+        JScrollPane scrollPane = new JScrollPane(table);
+
+        final JTextField searchField = new JTextField();
+        JButton searchButton = new JButton("Go");
+
+        ActionListener searchListener = new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+               searchTableModel.search(searchField.getText().trim().toLowerCase());
+                searchField.requestFocus();
+            }
+        };
+
+        searchButton.addActionListener(searchListener);
+        searchField.addActionListener(searchListener);
+
+
+
+        frame.getContentPane().setLayout(new BorderLayout());
+        frame.getContentPane().add(scrollPane, BorderLayout.CENTER);
+
+        JPanel searchPanel = new JPanel();
+        searchPanel.setLayout(new BorderLayout(10,10));
+        searchPanel.add(searchField, BorderLayout.CENTER);
+        searchPanel.add(searchButton, BorderLayout.EAST);
+
+        JPanel topPanel = new JPanel(new BorderLayout());
+        topPanel.add(searchPanel, BorderLayout.CENTER);
+        topPanel.add(new JPanel(), BorderLayout.EAST);
+        topPanel.add(new JPanel(), BorderLayout.WEST);
+        topPanel.add(new JPanel(), BorderLayout.NORTH);
+        topPanel.add(new JPanel(), BorderLayout.SOUTH);
+
+        frame.getContentPane().add(topPanel, BorderLayout.NORTH);
+
+        frame.setTitle("Lucene powered table searching");
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        frame.show();
+
+    }
+
+
+    public static void main(String[] args) {
+        new TableSearcherSimulator();
+    }
+
+}

Propchange: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TableSearcherSimulator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicList.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicList.java?rev=712922&r1=712921&r2=712922&view=diff
==============================================================================
--- lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicList.java (original)
+++ lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicList.java Mon Nov 10 18:35:46 2008
@@ -1,52 +1,52 @@
-package org.apache.lucene.swing.models;
-
-/**
- * Copyright 2005 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.swing.ListModel;
-
-import junit.framework.TestCase;
-
-/**
- **/
-public class TestBasicList extends TestCase {
-    private ListModel baseListModel;
-    private ListSearcher listSearcher;
-    private List list;
-
-    protected void setUp() throws Exception {
-        list = new ArrayList();
-        list.add(DataStore.canolis);
-        list.add(DataStore.chris);
-
-        baseListModel = new BaseListModel(list.iterator());
-        listSearcher = new ListSearcher(baseListModel);
-    }
-
-
-    public void testRows(){
-        assertEquals(list.size(), listSearcher.getSize());
-    }
-
-    public void testValueAt(){
-        assertEquals(baseListModel.getElementAt(0), listSearcher.getElementAt(0));
-        assertNotSame(baseListModel.getElementAt(1), listSearcher.getElementAt(0));
-    }
-
-}
+package org.apache.lucene.swing.models;
+
+/**
+ * Copyright 2005 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.ListModel;
+
+import junit.framework.TestCase;
+
+/**
+ **/
+public class TestBasicList extends TestCase {
+    private ListModel baseListModel;
+    private ListSearcher listSearcher;
+    private List list;
+
+    protected void setUp() throws Exception {
+        list = new ArrayList();
+        list.add(DataStore.canolis);
+        list.add(DataStore.chris);
+
+        baseListModel = new BaseListModel(list.iterator());
+        listSearcher = new ListSearcher(baseListModel);
+    }
+
+
+    public void testRows(){
+        assertEquals(list.size(), listSearcher.getSize());
+    }
+
+    public void testValueAt(){
+        assertEquals(baseListModel.getElementAt(0), listSearcher.getElementAt(0));
+        assertNotSame(baseListModel.getElementAt(1), listSearcher.getElementAt(0));
+    }
+
+}

Propchange: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicList.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicTable.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicTable.java?rev=712922&r1=712921&r2=712922&view=diff
==============================================================================
--- lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicTable.java (original)
+++ lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicTable.java Mon Nov 10 18:35:46 2008
@@ -1,58 +1,58 @@
-package org.apache.lucene.swing.models;
-
-/**
- * Copyright 2005 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.swing.table.TableModel;
-
-import junit.framework.TestCase;
-
-
-public class TestBasicTable extends TestCase {
-    private TableModel baseTableModel;
-    private TableSearcher tableSearcher;
-    private List list;
-
-    protected void setUp() throws Exception {
-        list = new ArrayList();
-        list.add(DataStore.canolis);
-        list.add(DataStore.chris);
-
-        baseTableModel = new BaseTableModel(list.iterator());
-        tableSearcher = new TableSearcher(baseTableModel);
-    }
-
-    public void testColumns(){
-
-        assertEquals(baseTableModel.getColumnCount(), tableSearcher.getColumnCount());
-        assertEquals(baseTableModel.getColumnName(0), tableSearcher.getColumnName(0));
-        assertNotSame(baseTableModel.getColumnName(0), tableSearcher.getColumnName(1));
-        assertEquals(baseTableModel.getColumnClass(0), tableSearcher.getColumnClass(0));
-    }
-
-    public void testRows(){
-        assertEquals(list.size(), tableSearcher.getRowCount());
-    }
-
-    public void testValueAt(){
-        assertEquals(baseTableModel.getValueAt(0,0), tableSearcher.getValueAt(0,0));
-        assertEquals(baseTableModel.getValueAt(0,3), tableSearcher.getValueAt(0,3));
-    }
-
-}
+package org.apache.lucene.swing.models;
+
+/**
+ * Copyright 2005 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.table.TableModel;
+
+import junit.framework.TestCase;
+
+
+public class TestBasicTable extends TestCase {
+    private TableModel baseTableModel;
+    private TableSearcher tableSearcher;
+    private List list;
+
+    protected void setUp() throws Exception {
+        list = new ArrayList();
+        list.add(DataStore.canolis);
+        list.add(DataStore.chris);
+
+        baseTableModel = new BaseTableModel(list.iterator());
+        tableSearcher = new TableSearcher(baseTableModel);
+    }
+
+    public void testColumns(){
+
+        assertEquals(baseTableModel.getColumnCount(), tableSearcher.getColumnCount());
+        assertEquals(baseTableModel.getColumnName(0), tableSearcher.getColumnName(0));
+        assertNotSame(baseTableModel.getColumnName(0), tableSearcher.getColumnName(1));
+        assertEquals(baseTableModel.getColumnClass(0), tableSearcher.getColumnClass(0));
+    }
+
+    public void testRows(){
+        assertEquals(list.size(), tableSearcher.getRowCount());
+    }
+
+    public void testValueAt(){
+        assertEquals(baseTableModel.getValueAt(0,0), tableSearcher.getValueAt(0,0));
+        assertEquals(baseTableModel.getValueAt(0,3), tableSearcher.getValueAt(0,3));
+    }
+
+}

Propchange: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestBasicTable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingList.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingList.java?rev=712922&r1=712921&r2=712922&view=diff
==============================================================================
--- lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingList.java (original)
+++ lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingList.java Mon Nov 10 18:35:46 2008
@@ -1,45 +1,45 @@
-package org.apache.lucene.swing.models;
-
-/**
- * Copyright 2005 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import javax.swing.ListModel;
-
-import junit.framework.TestCase;
-
-
- 
-public class TestSearchingList extends TestCase {
-    private ListModel baseListModel;
-    private ListSearcher listSearcher;
-
-    protected void setUp() throws Exception {
-        baseListModel = new BaseListModel(DataStore.getRestaurants());
-        listSearcher = new ListSearcher(baseListModel);
-    }
-
-    public void testSearch(){
-        //make sure data is there
-        assertEquals(baseListModel.getSize(), listSearcher.getSize());
-        //search for pino's
-        listSearcher.search("pino's");
-        assertEquals(1, listSearcher.getSize());
-        //clear search and check that
-        listSearcher.search(null);
-        assertEquals(baseListModel.getSize(), listSearcher.getSize());
-    }
-
-}
+package org.apache.lucene.swing.models;
+
+/**
+ * Copyright 2005 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import javax.swing.ListModel;
+
+import junit.framework.TestCase;
+
+
+ 
+public class TestSearchingList extends TestCase {
+    private ListModel baseListModel;
+    private ListSearcher listSearcher;
+
+    protected void setUp() throws Exception {
+        baseListModel = new BaseListModel(DataStore.getRestaurants());
+        listSearcher = new ListSearcher(baseListModel);
+    }
+
+    public void testSearch(){
+        //make sure data is there
+        assertEquals(baseListModel.getSize(), listSearcher.getSize());
+        //search for pino's
+        listSearcher.search("pino's");
+        assertEquals(1, listSearcher.getSize());
+        //clear search and check that
+        listSearcher.search(null);
+        assertEquals(baseListModel.getSize(), listSearcher.getSize());
+    }
+
+}

Propchange: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingList.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingTable.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingTable.java?rev=712922&r1=712921&r2=712922&view=diff
==============================================================================
--- lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingTable.java (original)
+++ lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingTable.java Mon Nov 10 18:35:46 2008
@@ -1,44 +1,44 @@
-package org.apache.lucene.swing.models;
-
-/**
- * Copyright 2005 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import junit.framework.TestCase;
-
-import javax.swing.table.TableModel;
-
-
-public class TestSearchingTable extends TestCase {
-    private TableModel baseTableModel;
-    private TableSearcher tableSearcher;
-
-    protected void setUp() throws Exception {
-        baseTableModel = new BaseTableModel(DataStore.getRestaurants());
-        tableSearcher = new TableSearcher(baseTableModel);
-    }
-
-    public void testSearch(){
-        //make sure data is there
-        assertEquals(baseTableModel.getRowCount(), tableSearcher.getRowCount());
-        //search for pino's
-        tableSearcher.search("pino's");
-        assertEquals(1, tableSearcher.getRowCount());
-        //clear search and check that
-        tableSearcher.search(null);
-        assertEquals(baseTableModel.getRowCount(), tableSearcher.getRowCount());
-    }
-
-}
+package org.apache.lucene.swing.models;
+
+/**
+ * Copyright 2005 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import junit.framework.TestCase;
+
+import javax.swing.table.TableModel;
+
+
+public class TestSearchingTable extends TestCase {
+    private TableModel baseTableModel;
+    private TableSearcher tableSearcher;
+
+    protected void setUp() throws Exception {
+        baseTableModel = new BaseTableModel(DataStore.getRestaurants());
+        tableSearcher = new TableSearcher(baseTableModel);
+    }
+
+    public void testSearch(){
+        //make sure data is there
+        assertEquals(baseTableModel.getRowCount(), tableSearcher.getRowCount());
+        //search for pino's
+        tableSearcher.search("pino's");
+        assertEquals(1, tableSearcher.getRowCount());
+        //clear search and check that
+        tableSearcher.search(null);
+        assertEquals(baseTableModel.getRowCount(), tableSearcher.getRowCount());
+    }
+
+}

Propchange: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestSearchingTable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingList.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingList.java?rev=712922&r1=712921&r2=712922&view=diff
==============================================================================
--- lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingList.java (original)
+++ lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingList.java Mon Nov 10 18:35:46 2008
@@ -1,77 +1,77 @@
-package org.apache.lucene.swing.models;
-
-/**
- * Copyright 2005 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import junit.framework.TestCase;
-
-
-public class TestUpdatingList extends TestCase {
-    private BaseListModel baseListModel;
-    private ListSearcher listSearcher;
-
-    RestaurantInfo infoToAdd1, infoToAdd2;
-
-    protected void setUp() throws Exception {
-        baseListModel = new BaseListModel(DataStore.getRestaurants());
-        listSearcher = new ListSearcher(baseListModel);
-
-        infoToAdd1 = new RestaurantInfo();
-        infoToAdd1.setName("Pino's");
-
-        infoToAdd2 = new RestaurantInfo();
-        infoToAdd2.setName("Pino's");
-        infoToAdd2.setType("Italian");
-    }
-
-    public void testAddWithoutSearch(){
-        assertEquals(baseListModel.getSize(), listSearcher.getSize());
-        int count = listSearcher.getSize();
-        baseListModel.addRow(infoToAdd1);
-        count++;
-        assertEquals(count, listSearcher.getSize());
-    }
-
-    public void testRemoveWithoutSearch(){
-        assertEquals(baseListModel.getSize(), listSearcher.getSize());
-        baseListModel.addRow(infoToAdd1);
-        int count = listSearcher.getSize();
-        baseListModel.removeRow(infoToAdd1);
-        count--;
-        assertEquals(count, listSearcher.getSize());
-    }
-
-    public void testAddWithSearch(){
-        assertEquals(baseListModel.getSize(), listSearcher.getSize());
-        listSearcher.search("pino's");
-        int count = listSearcher.getSize();
-        baseListModel.addRow(infoToAdd2);
-        count++;
-        assertEquals(count, listSearcher.getSize());
-    }
-
-    public void testRemoveWithSearch(){
-        assertEquals(baseListModel.getSize(), listSearcher.getSize());
-        baseListModel.addRow(infoToAdd1);
-        listSearcher.search("pino's");
-        int count = listSearcher.getSize();
-        baseListModel.removeRow(infoToAdd1);
-        count--;
-        assertEquals(count, listSearcher.getSize());
-    }
-
-
-}
+package org.apache.lucene.swing.models;
+
+/**
+ * Copyright 2005 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import junit.framework.TestCase;
+
+
+public class TestUpdatingList extends TestCase {
+    private BaseListModel baseListModel;
+    private ListSearcher listSearcher;
+
+    RestaurantInfo infoToAdd1, infoToAdd2;
+
+    protected void setUp() throws Exception {
+        baseListModel = new BaseListModel(DataStore.getRestaurants());
+        listSearcher = new ListSearcher(baseListModel);
+
+        infoToAdd1 = new RestaurantInfo();
+        infoToAdd1.setName("Pino's");
+
+        infoToAdd2 = new RestaurantInfo();
+        infoToAdd2.setName("Pino's");
+        infoToAdd2.setType("Italian");
+    }
+
+    public void testAddWithoutSearch(){
+        assertEquals(baseListModel.getSize(), listSearcher.getSize());
+        int count = listSearcher.getSize();
+        baseListModel.addRow(infoToAdd1);
+        count++;
+        assertEquals(count, listSearcher.getSize());
+    }
+
+    public void testRemoveWithoutSearch(){
+        assertEquals(baseListModel.getSize(), listSearcher.getSize());
+        baseListModel.addRow(infoToAdd1);
+        int count = listSearcher.getSize();
+        baseListModel.removeRow(infoToAdd1);
+        count--;
+        assertEquals(count, listSearcher.getSize());
+    }
+
+    public void testAddWithSearch(){
+        assertEquals(baseListModel.getSize(), listSearcher.getSize());
+        listSearcher.search("pino's");
+        int count = listSearcher.getSize();
+        baseListModel.addRow(infoToAdd2);
+        count++;
+        assertEquals(count, listSearcher.getSize());
+    }
+
+    public void testRemoveWithSearch(){
+        assertEquals(baseListModel.getSize(), listSearcher.getSize());
+        baseListModel.addRow(infoToAdd1);
+        listSearcher.search("pino's");
+        int count = listSearcher.getSize();
+        baseListModel.removeRow(infoToAdd1);
+        count--;
+        assertEquals(count, listSearcher.getSize());
+    }
+
+
+}

Propchange: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingList.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingTable.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingTable.java?rev=712922&r1=712921&r2=712922&view=diff
==============================================================================
--- lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingTable.java (original)
+++ lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingTable.java Mon Nov 10 18:35:46 2008
@@ -1,77 +1,77 @@
-package org.apache.lucene.swing.models;
-
-/**
- * Copyright 2005 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import junit.framework.TestCase;
-
-
-public class TestUpdatingTable extends TestCase {
-    private BaseTableModel baseTableModel;
-    private TableSearcher tableSearcher;
-
-    RestaurantInfo infoToAdd1, infoToAdd2;
-
-    protected void setUp() throws Exception {
-        baseTableModel = new BaseTableModel(DataStore.getRestaurants());
-        tableSearcher = new TableSearcher(baseTableModel);
-
-        infoToAdd1 = new RestaurantInfo();
-        infoToAdd1.setName("Pino's");
-        infoToAdd1.setType("Italian");
-
-        infoToAdd2 = new RestaurantInfo();
-        infoToAdd2.setName("Pino's");
-        infoToAdd2.setType("Italian");
-    }
-
-    public void testAddWithoutSearch(){
-        assertEquals(baseTableModel.getRowCount(), tableSearcher.getRowCount());
-        int count = tableSearcher.getRowCount();
-        baseTableModel.addRow(infoToAdd1);
-        count++;
-        assertEquals(count, tableSearcher.getRowCount());
-    }
-
-    public void testRemoveWithoutSearch(){
-        assertEquals(baseTableModel.getRowCount(), tableSearcher.getRowCount());
-        int count = tableSearcher.getRowCount();
-        baseTableModel.addRow(infoToAdd1);
-        baseTableModel.removeRow(infoToAdd1);
-        assertEquals(count, tableSearcher.getRowCount());
-    }
-
-    public void testAddWithSearch(){
-        assertEquals(baseTableModel.getRowCount(), tableSearcher.getRowCount());
-        tableSearcher.search("pino's");
-        int count = tableSearcher.getRowCount();
-        baseTableModel.addRow(infoToAdd2);
-        count++;
-        assertEquals(count, tableSearcher.getRowCount());
-    }
-
-    public void testRemoveWithSearch(){
-        assertEquals(baseTableModel.getRowCount(), tableSearcher.getRowCount());
-        baseTableModel.addRow(infoToAdd1);
-        tableSearcher.search("pino's");
-        int count = tableSearcher.getRowCount();
-        baseTableModel.removeRow(infoToAdd1);
-        count--;
-        assertEquals(count, tableSearcher.getRowCount());
-    }
-
-
-}
+package org.apache.lucene.swing.models;
+
+/**
+ * Copyright 2005 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import junit.framework.TestCase;
+
+
+public class TestUpdatingTable extends TestCase {
+    private BaseTableModel baseTableModel;
+    private TableSearcher tableSearcher;
+
+    RestaurantInfo infoToAdd1, infoToAdd2;
+
+    protected void setUp() throws Exception {
+        baseTableModel = new BaseTableModel(DataStore.getRestaurants());
+        tableSearcher = new TableSearcher(baseTableModel);
+
+        infoToAdd1 = new RestaurantInfo();
+        infoToAdd1.setName("Pino's");
+        infoToAdd1.setType("Italian");
+
+        infoToAdd2 = new RestaurantInfo();
+        infoToAdd2.setName("Pino's");
+        infoToAdd2.setType("Italian");
+    }
+
+    public void testAddWithoutSearch(){
+        assertEquals(baseTableModel.getRowCount(), tableSearcher.getRowCount());
+        int count = tableSearcher.getRowCount();
+        baseTableModel.addRow(infoToAdd1);
+        count++;
+        assertEquals(count, tableSearcher.getRowCount());
+    }
+
+    public void testRemoveWithoutSearch(){
+        assertEquals(baseTableModel.getRowCount(), tableSearcher.getRowCount());
+        int count = tableSearcher.getRowCount();
+        baseTableModel.addRow(infoToAdd1);
+        baseTableModel.removeRow(infoToAdd1);
+        assertEquals(count, tableSearcher.getRowCount());
+    }
+
+    public void testAddWithSearch(){
+        assertEquals(baseTableModel.getRowCount(), tableSearcher.getRowCount());
+        tableSearcher.search("pino's");
+        int count = tableSearcher.getRowCount();
+        baseTableModel.addRow(infoToAdd2);
+        count++;
+        assertEquals(count, tableSearcher.getRowCount());
+    }
+
+    public void testRemoveWithSearch(){
+        assertEquals(baseTableModel.getRowCount(), tableSearcher.getRowCount());
+        baseTableModel.addRow(infoToAdd1);
+        tableSearcher.search("pino's");
+        int count = tableSearcher.getRowCount();
+        baseTableModel.removeRow(infoToAdd1);
+        count--;
+        assertEquals(count, tableSearcher.getRowCount());
+    }
+
+
+}

Propchange: lucene/java/trunk/contrib/swing/src/test/org/apache/lucene/swing/models/TestUpdatingTable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/trunk/contrib/xml-query-parser/src/demo/java/org/apache/lucene/xmlparser/webdemo/FormBasedXmlQueryDemo.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/xml-query-parser/src/demo/java/org/apache/lucene/xmlparser/webdemo/FormBasedXmlQueryDemo.java?rev=712922&r1=712921&r2=712922&view=diff
==============================================================================
--- lucene/java/trunk/contrib/xml-query-parser/src/demo/java/org/apache/lucene/xmlparser/webdemo/FormBasedXmlQueryDemo.java (original)
+++ lucene/java/trunk/contrib/xml-query-parser/src/demo/java/org/apache/lucene/xmlparser/webdemo/FormBasedXmlQueryDemo.java Mon Nov 10 18:35:46 2008
@@ -1,133 +1,133 @@
-package org.apache.lucene.xmlparser.webdemo;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Enumeration;
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.lucene.analysis.Analyzer;
-import org.apache.lucene.analysis.standard.StandardAnalyzer;
-import org.apache.lucene.document.Document;
-import org.apache.lucene.document.Field;
-import org.apache.lucene.index.CorruptIndexException;
-import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.search.IndexSearcher;
-import org.apache.lucene.search.Query;
-import org.apache.lucene.search.ScoreDoc;
-import org.apache.lucene.search.TopDocs;
-import org.apache.lucene.store.RAMDirectory;
-import org.apache.lucene.xmlparser.CorePlusExtensionsParser;
-import org.apache.lucene.xmlparser.QueryTemplateManager;
-
-public class FormBasedXmlQueryDemo extends HttpServlet {
-
-	private QueryTemplateManager queryTemplateManager;
-	private CorePlusExtensionsParser xmlParser;
-	private IndexSearcher searcher;
-	private Analyzer analyzer=new StandardAnalyzer();
-
-	public void init(ServletConfig config) throws ServletException {
-		super.init(config);
-		try {
-			openExampleIndex();
-
-			//load servlet configuration settings
-			String xslFile=config.getInitParameter("xslFile");
-			String defaultStandardQueryParserField = config.getInitParameter("defaultStandardQueryParserField");
-
-
-			//Load and cache choice of XSL query template using QueryTemplateManager
-			queryTemplateManager=new QueryTemplateManager(
-					getServletContext().getResourceAsStream("/WEB-INF/"+xslFile));
-
-			//initialize an XML Query Parser for use by all threads
-			xmlParser=new CorePlusExtensionsParser(defaultStandardQueryParserField,analyzer);
-		} catch (Exception e) {
-			throw new ServletException("Error loading query template",e);
-		}
-	}
-
-	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-		//Take all completed form fields and add to a Properties object
-		Properties completedFormFields=new Properties();
-		Enumeration pNames = request.getParameterNames();
-		while(pNames.hasMoreElements()){
-			String propName=(String) pNames.nextElement();
-			String value=request.getParameter(propName);
-			if((value!=null)&&(value.trim().length()>0)){
-				completedFormFields.setProperty(propName, value);
-			}
-		}
-
-		try{
-
-			//Create an XML query by populating template with given user criteria
-			org.w3c.dom.Document xmlQuery=queryTemplateManager.getQueryAsDOM(completedFormFields);
-
-			//Parse the XML to produce a Lucene query
-			Query query=xmlParser.getQuery(xmlQuery.getDocumentElement());
-
-			//Run the query
-			TopDocs topDocs = searcher.search(query,10);
-
-			//and package the results and forward to JSP
-			if(topDocs!=null)	{
-				ScoreDoc[] sd = topDocs.scoreDocs;
-				Document[] results=new Document[sd.length];
-				for (int i = 0; i < results.length; i++) {
-					results[i]=searcher.doc(sd[i].doc);
-					request.setAttribute("results", results);
-				}
-			}
-			RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/index.jsp");
-			dispatcher.forward(request,response);
-		}
-		catch(Exception e){
-			throw new ServletException("Error processing query",e);
-		}
-	}
-
-	private void openExampleIndex() throws CorruptIndexException, IOException {
-
-		//Create a RAM-based index from our test data file
-		RAMDirectory rd=new RAMDirectory();
-		IndexWriter writer=new IndexWriter (rd,analyzer,IndexWriter.MaxFieldLength.LIMITED);
-		InputStream dataIn=getServletContext().getResourceAsStream("/WEB-INF/data.tsv");
-		BufferedReader br = new BufferedReader(new InputStreamReader(dataIn));
-		String line = br.readLine();
-		while(line!=null)
-		{
-			line=line.trim();
-			if(line.length()>0)
-			{
-				//parse row and create a document
-				StringTokenizer st=new StringTokenizer(line,"\t");
-				Document doc=new Document();
-				doc.add(new Field("location",st.nextToken(),Field.Store.YES,
-						Field.Index.ANALYZED_NO_NORMS));
-				doc.add(new Field("salary",st.nextToken(),Field.Store.YES,
-						Field.Index.ANALYZED_NO_NORMS));
-				doc.add(new Field("type",st.nextToken(),Field.Store.YES,
-						Field.Index.ANALYZED_NO_NORMS));
-				doc.add(new Field("description",st.nextToken(),Field.Store.YES,
-						Field.Index.ANALYZED));
-				writer.addDocument(doc);
-			}
-			line=br.readLine();
-		}
-		writer.close();
-
-		//open searcher
-		searcher=new IndexSearcher(rd);
-	}
-}
+package org.apache.lucene.xmlparser.webdemo;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Enumeration;
+import java.util.Properties;
+import java.util.StringTokenizer;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.analysis.standard.StandardAnalyzer;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field;
+import org.apache.lucene.index.CorruptIndexException;
+import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.ScoreDoc;
+import org.apache.lucene.search.TopDocs;
+import org.apache.lucene.store.RAMDirectory;
+import org.apache.lucene.xmlparser.CorePlusExtensionsParser;
+import org.apache.lucene.xmlparser.QueryTemplateManager;
+
+public class FormBasedXmlQueryDemo extends HttpServlet {
+
+	private QueryTemplateManager queryTemplateManager;
+	private CorePlusExtensionsParser xmlParser;
+	private IndexSearcher searcher;
+	private Analyzer analyzer=new StandardAnalyzer();
+
+	public void init(ServletConfig config) throws ServletException {
+		super.init(config);
+		try {
+			openExampleIndex();
+
+			//load servlet configuration settings
+			String xslFile=config.getInitParameter("xslFile");
+			String defaultStandardQueryParserField = config.getInitParameter("defaultStandardQueryParserField");
+
+
+			//Load and cache choice of XSL query template using QueryTemplateManager
+			queryTemplateManager=new QueryTemplateManager(
+					getServletContext().getResourceAsStream("/WEB-INF/"+xslFile));
+
+			//initialize an XML Query Parser for use by all threads
+			xmlParser=new CorePlusExtensionsParser(defaultStandardQueryParserField,analyzer);
+		} catch (Exception e) {
+			throw new ServletException("Error loading query template",e);
+		}
+	}
+
+	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+		//Take all completed form fields and add to a Properties object
+		Properties completedFormFields=new Properties();
+		Enumeration pNames = request.getParameterNames();
+		while(pNames.hasMoreElements()){
+			String propName=(String) pNames.nextElement();
+			String value=request.getParameter(propName);
+			if((value!=null)&&(value.trim().length()>0)){
+				completedFormFields.setProperty(propName, value);
+			}
+		}
+
+		try{
+
+			//Create an XML query by populating template with given user criteria
+			org.w3c.dom.Document xmlQuery=queryTemplateManager.getQueryAsDOM(completedFormFields);
+
+			//Parse the XML to produce a Lucene query
+			Query query=xmlParser.getQuery(xmlQuery.getDocumentElement());
+
+			//Run the query
+			TopDocs topDocs = searcher.search(query,10);
+
+			//and package the results and forward to JSP
+			if(topDocs!=null)	{
+				ScoreDoc[] sd = topDocs.scoreDocs;
+				Document[] results=new Document[sd.length];
+				for (int i = 0; i < results.length; i++) {
+					results[i]=searcher.doc(sd[i].doc);
+					request.setAttribute("results", results);
+				}
+			}
+			RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/index.jsp");
+			dispatcher.forward(request,response);
+		}
+		catch(Exception e){
+			throw new ServletException("Error processing query",e);
+		}
+	}
+
+	private void openExampleIndex() throws CorruptIndexException, IOException {
+
+		//Create a RAM-based index from our test data file
+		RAMDirectory rd=new RAMDirectory();
+		IndexWriter writer=new IndexWriter (rd,analyzer,IndexWriter.MaxFieldLength.LIMITED);
+		InputStream dataIn=getServletContext().getResourceAsStream("/WEB-INF/data.tsv");
+		BufferedReader br = new BufferedReader(new InputStreamReader(dataIn));
+		String line = br.readLine();
+		while(line!=null)
+		{
+			line=line.trim();
+			if(line.length()>0)
+			{
+				//parse row and create a document
+				StringTokenizer st=new StringTokenizer(line,"\t");
+				Document doc=new Document();
+				doc.add(new Field("location",st.nextToken(),Field.Store.YES,
+						Field.Index.ANALYZED_NO_NORMS));
+				doc.add(new Field("salary",st.nextToken(),Field.Store.YES,
+						Field.Index.ANALYZED_NO_NORMS));
+				doc.add(new Field("type",st.nextToken(),Field.Store.YES,
+						Field.Index.ANALYZED_NO_NORMS));
+				doc.add(new Field("description",st.nextToken(),Field.Store.YES,
+						Field.Index.ANALYZED));
+				writer.addDocument(doc);
+			}
+			line=br.readLine();
+		}
+		writer.close();
+
+		//open searcher
+		searcher=new IndexSearcher(rd);
+	}
+}

Propchange: lucene/java/trunk/contrib/xml-query-parser/src/demo/java/org/apache/lucene/xmlparser/webdemo/FormBasedXmlQueryDemo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/trunk/contrib/xml-query-parser/src/java/org/apache/lucene/xmlparser/CoreParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/xml-query-parser/src/java/org/apache/lucene/xmlparser/CoreParser.java?rev=712922&r1=712921&r2=712922&view=diff
==============================================================================
--- lucene/java/trunk/contrib/xml-query-parser/src/java/org/apache/lucene/xmlparser/CoreParser.java (original)
+++ lucene/java/trunk/contrib/xml-query-parser/src/java/org/apache/lucene/xmlparser/CoreParser.java Mon Nov 10 18:35:46 2008
@@ -1,180 +1,180 @@
-package org.apache.lucene.xmlparser;
-
-import java.io.InputStream;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.apache.lucene.analysis.Analyzer;
-import org.apache.lucene.queryParser.QueryParser;
-import org.apache.lucene.search.Query;
-import org.apache.lucene.xmlparser.builders.BooleanQueryBuilder;
-import org.apache.lucene.xmlparser.builders.ConstantScoreQueryBuilder;
-import org.apache.lucene.xmlparser.builders.FilteredQueryBuilder;
-import org.apache.lucene.xmlparser.builders.MatchAllDocsQueryBuilder;
-import org.apache.lucene.xmlparser.builders.CachedFilterBuilder;
-import org.apache.lucene.xmlparser.builders.RangeFilterBuilder;
-import org.apache.lucene.xmlparser.builders.SpanFirstBuilder;
-import org.apache.lucene.xmlparser.builders.SpanNearBuilder;
-import org.apache.lucene.xmlparser.builders.SpanNotBuilder;
-import org.apache.lucene.xmlparser.builders.SpanOrBuilder;
-import org.apache.lucene.xmlparser.builders.SpanOrTermsBuilder;
-import org.apache.lucene.xmlparser.builders.SpanQueryBuilderFactory;
-import org.apache.lucene.xmlparser.builders.SpanTermBuilder;
-import org.apache.lucene.xmlparser.builders.TermQueryBuilder;
-import org.apache.lucene.xmlparser.builders.TermsQueryBuilder;
-import org.apache.lucene.xmlparser.builders.UserInputQueryBuilder;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Assembles a QueryBuilder which uses only core Lucene Query objects
- *
- */
-public class CoreParser implements QueryBuilder
-{
-	
-	protected Analyzer analyzer;
-	protected QueryParser parser;
-	protected QueryBuilderFactory queryFactory;
-	protected FilterBuilderFactory filterFactory;
-	//Controls the max size of the LRU cache used for QueryFilter objects parsed.
-	public static int maxNumCachedFilters=20;
-
-
-	/**
-	 * Construct an XML parser that uses a single instance QueryParser for handling 
-	 * UserQuery tags - all parse operations are synchronised on this parser
-	 * @param analyzer
-	 * @param parser A QueryParser which will be synchronized on during parse calls.
-	 */
-	public CoreParser(Analyzer analyzer, QueryParser parser)
-	{
-		this(null,analyzer,parser);
-	}
-	
-	/**
-	 * Constructs an XML parser that creates a QueryParser for each UserQuery request.
-	 * @param defaultField The default field name used by QueryParsers constructed for UserQuery tags 
-	 * @param analyzer 
-	 */
-	public CoreParser(String defaultField, Analyzer analyzer)
-	{
-		this(defaultField,analyzer,null);
-	}	
-	
-	protected CoreParser(String defaultField,Analyzer analyzer, QueryParser parser)
-	{
-		this.analyzer=analyzer;
-		this.parser=parser;
-		filterFactory = new FilterBuilderFactory();
-		filterFactory.addBuilder("RangeFilter",new RangeFilterBuilder());
-		
-		
-		queryFactory = new QueryBuilderFactory();
-		queryFactory.addBuilder("TermQuery",new TermQueryBuilder());
-		queryFactory.addBuilder("TermsQuery",new TermsQueryBuilder(analyzer));
-		queryFactory.addBuilder("MatchAllDocsQuery",new MatchAllDocsQueryBuilder());
-		queryFactory.addBuilder("BooleanQuery",new BooleanQueryBuilder(queryFactory));
-		if(parser!=null)
-		{
-			queryFactory.addBuilder("UserQuery",new UserInputQueryBuilder(parser));
-		}
-		else
-		{
-			queryFactory.addBuilder("UserQuery",new UserInputQueryBuilder(defaultField,analyzer));			
-		}
-		queryFactory.addBuilder("FilteredQuery",new FilteredQueryBuilder(filterFactory,queryFactory));
-		queryFactory.addBuilder("ConstantScoreQuery",new ConstantScoreQueryBuilder(filterFactory));
-		
-		filterFactory.addBuilder("CachedFilter",new CachedFilterBuilder(queryFactory,
-							filterFactory, maxNumCachedFilters));
-		
-		
-		SpanQueryBuilderFactory sqof=new SpanQueryBuilderFactory();
-
-		SpanNearBuilder snb=new SpanNearBuilder(sqof);
-		sqof.addBuilder("SpanNear",snb);
-		queryFactory.addBuilder("SpanNear",snb);
-
-		SpanTermBuilder snt=new SpanTermBuilder();
-		sqof.addBuilder("SpanTerm",snt);
-		queryFactory.addBuilder("SpanTerm",snt);
-		
-		SpanOrBuilder sot=new SpanOrBuilder(sqof);
-		sqof.addBuilder("SpanOr",sot);
-		queryFactory.addBuilder("SpanOr",sot);
-
-		SpanOrTermsBuilder sots=new SpanOrTermsBuilder(analyzer);
-		sqof.addBuilder("SpanOrTerms",sots);
-		queryFactory.addBuilder("SpanOrTerms",sots);		
-		
-		SpanFirstBuilder sft=new SpanFirstBuilder(sqof);
-		sqof.addBuilder("SpanFirst",sft);
-		queryFactory.addBuilder("SpanFirst",sft);
-		
-		SpanNotBuilder snot=new SpanNotBuilder(sqof);
-		sqof.addBuilder("SpanNot",snot);
-		queryFactory.addBuilder("SpanNot",snot);	
-	}
-	
-	public Query parse(InputStream xmlStream) throws ParserException
-	{
-		return getQuery(parseXML(xmlStream).getDocumentElement());
-	}
-	
-	public void addQueryBuilder(String nodeName,QueryBuilder builder)
-	{
-		queryFactory.addBuilder(nodeName,builder);
-	}
-	public void addFilterBuilder(String nodeName,FilterBuilder builder)
-	{
-		filterFactory.addBuilder(nodeName,builder);
-	}
-	
-	private static Document parseXML(InputStream pXmlFile) throws ParserException
-	{
-		DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
-		DocumentBuilder db = null;
-		try
-		{
-			db = dbf.newDocumentBuilder();
-		}
-		catch (Exception se)
-		{
-			throw new ParserException("XML Parser configuration error", se);
-		}
-		org.w3c.dom.Document doc = null;
-		try
-		{
-			doc = db.parse(pXmlFile);
-		}
-		catch (Exception se)
-		{
-			throw new ParserException("Error parsing XML stream:" + se, se);
-		}
-		return doc;
-	}
-	
-
-	public Query getQuery(Element e) throws ParserException
-	{
-		return queryFactory.getQuery(e);
-	}
-}
+package org.apache.lucene.xmlparser;
+
+import java.io.InputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.queryParser.QueryParser;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.xmlparser.builders.BooleanQueryBuilder;
+import org.apache.lucene.xmlparser.builders.ConstantScoreQueryBuilder;
+import org.apache.lucene.xmlparser.builders.FilteredQueryBuilder;
+import org.apache.lucene.xmlparser.builders.MatchAllDocsQueryBuilder;
+import org.apache.lucene.xmlparser.builders.CachedFilterBuilder;
+import org.apache.lucene.xmlparser.builders.RangeFilterBuilder;
+import org.apache.lucene.xmlparser.builders.SpanFirstBuilder;
+import org.apache.lucene.xmlparser.builders.SpanNearBuilder;
+import org.apache.lucene.xmlparser.builders.SpanNotBuilder;
+import org.apache.lucene.xmlparser.builders.SpanOrBuilder;
+import org.apache.lucene.xmlparser.builders.SpanOrTermsBuilder;
+import org.apache.lucene.xmlparser.builders.SpanQueryBuilderFactory;
+import org.apache.lucene.xmlparser.builders.SpanTermBuilder;
+import org.apache.lucene.xmlparser.builders.TermQueryBuilder;
+import org.apache.lucene.xmlparser.builders.TermsQueryBuilder;
+import org.apache.lucene.xmlparser.builders.UserInputQueryBuilder;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Assembles a QueryBuilder which uses only core Lucene Query objects
+ *
+ */
+public class CoreParser implements QueryBuilder
+{
+	
+	protected Analyzer analyzer;
+	protected QueryParser parser;
+	protected QueryBuilderFactory queryFactory;
+	protected FilterBuilderFactory filterFactory;
+	//Controls the max size of the LRU cache used for QueryFilter objects parsed.
+	public static int maxNumCachedFilters=20;
+
+
+	/**
+	 * Construct an XML parser that uses a single instance QueryParser for handling 
+	 * UserQuery tags - all parse operations are synchronised on this parser
+	 * @param analyzer
+	 * @param parser A QueryParser which will be synchronized on during parse calls.
+	 */
+	public CoreParser(Analyzer analyzer, QueryParser parser)
+	{
+		this(null,analyzer,parser);
+	}
+	
+	/**
+	 * Constructs an XML parser that creates a QueryParser for each UserQuery request.
+	 * @param defaultField The default field name used by QueryParsers constructed for UserQuery tags 
+	 * @param analyzer 
+	 */
+	public CoreParser(String defaultField, Analyzer analyzer)
+	{
+		this(defaultField,analyzer,null);
+	}	
+	
+	protected CoreParser(String defaultField,Analyzer analyzer, QueryParser parser)
+	{
+		this.analyzer=analyzer;
+		this.parser=parser;
+		filterFactory = new FilterBuilderFactory();
+		filterFactory.addBuilder("RangeFilter",new RangeFilterBuilder());
+		
+		
+		queryFactory = new QueryBuilderFactory();
+		queryFactory.addBuilder("TermQuery",new TermQueryBuilder());
+		queryFactory.addBuilder("TermsQuery",new TermsQueryBuilder(analyzer));
+		queryFactory.addBuilder("MatchAllDocsQuery",new MatchAllDocsQueryBuilder());
+		queryFactory.addBuilder("BooleanQuery",new BooleanQueryBuilder(queryFactory));
+		if(parser!=null)
+		{
+			queryFactory.addBuilder("UserQuery",new UserInputQueryBuilder(parser));
+		}
+		else
+		{
+			queryFactory.addBuilder("UserQuery",new UserInputQueryBuilder(defaultField,analyzer));			
+		}
+		queryFactory.addBuilder("FilteredQuery",new FilteredQueryBuilder(filterFactory,queryFactory));
+		queryFactory.addBuilder("ConstantScoreQuery",new ConstantScoreQueryBuilder(filterFactory));
+		
+		filterFactory.addBuilder("CachedFilter",new CachedFilterBuilder(queryFactory,
+							filterFactory, maxNumCachedFilters));
+		
+		
+		SpanQueryBuilderFactory sqof=new SpanQueryBuilderFactory();
+
+		SpanNearBuilder snb=new SpanNearBuilder(sqof);
+		sqof.addBuilder("SpanNear",snb);
+		queryFactory.addBuilder("SpanNear",snb);
+
+		SpanTermBuilder snt=new SpanTermBuilder();
+		sqof.addBuilder("SpanTerm",snt);
+		queryFactory.addBuilder("SpanTerm",snt);
+		
+		SpanOrBuilder sot=new SpanOrBuilder(sqof);
+		sqof.addBuilder("SpanOr",sot);
+		queryFactory.addBuilder("SpanOr",sot);
+
+		SpanOrTermsBuilder sots=new SpanOrTermsBuilder(analyzer);
+		sqof.addBuilder("SpanOrTerms",sots);
+		queryFactory.addBuilder("SpanOrTerms",sots);		
+		
+		SpanFirstBuilder sft=new SpanFirstBuilder(sqof);
+		sqof.addBuilder("SpanFirst",sft);
+		queryFactory.addBuilder("SpanFirst",sft);
+		
+		SpanNotBuilder snot=new SpanNotBuilder(sqof);
+		sqof.addBuilder("SpanNot",snot);
+		queryFactory.addBuilder("SpanNot",snot);	
+	}
+	
+	public Query parse(InputStream xmlStream) throws ParserException
+	{
+		return getQuery(parseXML(xmlStream).getDocumentElement());
+	}
+	
+	public void addQueryBuilder(String nodeName,QueryBuilder builder)
+	{
+		queryFactory.addBuilder(nodeName,builder);
+	}
+	public void addFilterBuilder(String nodeName,FilterBuilder builder)
+	{
+		filterFactory.addBuilder(nodeName,builder);
+	}
+	
+	private static Document parseXML(InputStream pXmlFile) throws ParserException
+	{
+		DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+		DocumentBuilder db = null;
+		try
+		{
+			db = dbf.newDocumentBuilder();
+		}
+		catch (Exception se)
+		{
+			throw new ParserException("XML Parser configuration error", se);
+		}
+		org.w3c.dom.Document doc = null;
+		try
+		{
+			doc = db.parse(pXmlFile);
+		}
+		catch (Exception se)
+		{
+			throw new ParserException("Error parsing XML stream:" + se, se);
+		}
+		return doc;
+	}
+	
+
+	public Query getQuery(Element e) throws ParserException
+	{
+		return queryFactory.getQuery(e);
+	}
+}

Propchange: lucene/java/trunk/contrib/xml-query-parser/src/java/org/apache/lucene/xmlparser/CoreParser.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message