OSDN Git Service

removed all files
[xerial/xerial-core.git] / src / main / java / org / xerial / util / xml / index / InvertedPath.java
diff --git a/src/main/java/org/xerial/util/xml/index/InvertedPath.java b/src/main/java/org/xerial/util/xml/index/InvertedPath.java
deleted file mode 100755 (executable)
index 9255ac7..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-/*--------------------------------------------------------------------------\r
- *  Copyright 2004 Taro L. Saito\r
- *\r
- *  Licensed under the Apache License, Version 2.0 (the "License");\r
- *  you may not use this file except in compliance with the License.\r
- *  You may obtain a copy of the License at\r
- *\r
- *     http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- *--------------------------------------------------------------------------*/\r
-//--------------------------------------\r
-// XerialJ Project\r
-//\r
-// InvertedPath.java\r
-// Since: 2005/06/02\r
-//\r
-// $URL: http://www.xerial.org/svn/project/XerialJ/trunk/xerial-core/src/main/java/org/xerial/util/xml/index/InvertedPath.java $ \r
-// $Author: leo $\r
-//--------------------------------------\r
-package org.xerial.util.xml.index;\r
-\r
-import java.util.Iterator;\r
-import java.util.LinkedList;\r
-import java.util.NoSuchElementException;\r
-\r
-import org.xerial.util.Algorithm;\r
-\r
-/**\r
- * InvertedPath is a reversed path. For example, the inverted path of a xpath\r
- * expression /booklist/book/author, is author.book.booklist\r
- * \r
- * @author leo\r
- * \r
- */\r
-public class InvertedPath implements Comparable<InvertedPath>, Iterable<String>\r
-{\r
-    private LinkedList<String> _path = new LinkedList<String>();\r
-\r
-    /**\r
-     * \r
-     */\r
-    public InvertedPath()\r
-    {\r
-        super();\r
-    }\r
-\r
-    public InvertedPath(String stringRepresentationOfInvertedPath)\r
-    {\r
-        String[] pathComponent = stringRepresentationOfInvertedPath.split("\\.");\r
-        for (String c : pathComponent)\r
-        {\r
-            addParent(c);\r
-        }\r
-    }\r
-\r
-    /**\r
-     * copy constructor\r
-     * \r
-     * @param invertedPath\r
-     */\r
-    public InvertedPath(InvertedPath invertedPath)\r
-    {\r
-        for (String s : invertedPath)\r
-            addParent(s);\r
-    }\r
-\r
-    public void addParent(String tagName)\r
-    {\r
-        _path.add(tagName);\r
-    }\r
-\r
-    public void addChild(String tagName)\r
-    {\r
-        _path.addFirst(tagName);\r
-    }\r
-\r
-    public String getLastParent()\r
-    {\r
-        if (_path.isEmpty())\r
-            return "";\r
-        else\r
-            return _path.getLast();\r
-    }\r
-\r
-    /**\r
-     * @throws NoSuchElementException\r
-     *             if this inverted path contains no step\r
-     */\r
-    public void removeLastParent() throws NoSuchElementException\r
-    {\r
-        if (_path.isEmpty())\r
-            throw new NoSuchElementException("empty path");\r
-        _path.removeLast();\r
-    }\r
-\r
-    public void removeFirstChild() throws NoSuchElementException\r
-    {\r
-        if (_path.isEmpty())\r
-            throw new NoSuchElementException("empty path");\r
-        _path.removeFirst();\r
-    }\r
-\r
-    public Integer size()\r
-    {\r
-        return _path.size();\r
-    }\r
-\r
-    public String toString()\r
-    {\r
-        StringBuilder builder = new StringBuilder();\r
-        for (String tag : _path)\r
-        {\r
-            builder.append(".");\r
-            builder.append(tag);\r
-        }\r
-        if (builder.length() > 1)\r
-            return builder.substring(1);\r
-        else\r
-            return "";\r
-    }\r
-\r
-    // @see java.lang.Comparable#compareTo(java.lang.Object)\r
-    public int compareTo(InvertedPath other)\r
-    {\r
-        return Algorithm.lexicographicalCompare(this.getPath(), other.getPath());\r
-    }\r
-\r
-    @Override\r
-    public boolean equals(Object obj)\r
-    {\r
-        InvertedPath other = (InvertedPath) obj;\r
-        if (obj == null)\r
-            return false;\r
-\r
-        return this.compareTo(other) == 0;\r
-    }\r
-\r
-    private LinkedList<String> getPath()\r
-    {\r
-        return _path;\r
-    }\r
-\r
-    public Iterator<String> iterator()\r
-    {\r
-        return _path.iterator();\r
-    }\r
-\r
-}\r