Permalink
Browse files

remove all gedcom-lib stuff

  • Loading branch information...
1 parent 76269c1 commit 64f7730a197b0171568dd44cc645373faeab9f56 @ssi-appstatus ssi-appstatus committed Oct 7, 2012
Showing with 9 additions and 4,563 deletions.
  1. +5 −25 pom.xml
  2. +0 −238 src/main/java/nu/mine/mosher/collection/TreeNode.java
  3. +0 −228 src/main/java/nu/mine/mosher/gedcom/Gedcom.java
  4. +0 −78 src/main/java/nu/mine/mosher/gedcom/GedcomConcatenator.java
  5. +0 −229 src/main/java/nu/mine/mosher/gedcom/GedcomLine.java
  6. +0 −203 src/main/java/nu/mine/mosher/gedcom/GedcomParser.java
  7. +0 −95 src/main/java/nu/mine/mosher/gedcom/GedcomTag.java
  8. +0 −123 src/main/java/nu/mine/mosher/gedcom/GedcomTree.java
  9. +0 −158 src/main/java/nu/mine/mosher/gedcom/date/DatePeriod.java
  10. +0 −257 src/main/java/nu/mine/mosher/gedcom/date/DateRange.java
  11. +0 −378 src/main/java/nu/mine/mosher/gedcom/date/YMD.java
  12. +0 −38 src/main/java/nu/mine/mosher/gedcom/exception/GedcomParseException.java
  13. +0 −17 src/main/java/nu/mine/mosher/gedcom/exception/IllegalLevel.java
  14. +0 −16 src/main/java/nu/mine/mosher/gedcom/exception/InvalidID.java
  15. +0 −15 src/main/java/nu/mine/mosher/gedcom/exception/InvalidLevel.java
  16. +0 −17 src/main/java/nu/mine/mosher/gedcom/exception/MissingTag.java
  17. +4 −3 src/main/java/nu/mine/mosher/gedcom/servlet/GedcomServlet.java
  18. +0 −520 src/main/java/nu/mine/mosher/gedcom/servlet/Loader.java
  19. +0 −66 src/main/java/nu/mine/mosher/gedcom/servlet/struct/Event.java
  20. +0 −70 src/main/java/nu/mine/mosher/gedcom/servlet/struct/EventNames.java
  21. +0 −63 src/main/java/nu/mine/mosher/gedcom/servlet/struct/FamilyEvent.java
  22. +0 −33 src/main/java/nu/mine/mosher/gedcom/servlet/struct/GedcomFile.java
  23. +0 −72 src/main/java/nu/mine/mosher/gedcom/servlet/struct/Partnership.java
  24. +0 −391 src/main/java/nu/mine/mosher/gedcom/servlet/struct/Person.java
  25. +0 −109 src/main/java/nu/mine/mosher/gedcom/servlet/struct/Source.java
  26. +0 −151 src/main/java/nu/mine/mosher/time/Time.java
  27. +0 −407 src/main/javacc/GedcomDateValueParser.jj
  28. +0 −215 src/test/java/nu/mine/mosher/collection/TreeNodeTest.java
  29. +0 −100 src/test/java/nu/mine/mosher/gedcom/date/YMDTest.java
  30. +0 −173 src/test/java/nu/mine/mosher/gedcom/date/parser/GedcomDateValueParserTest.java
  31. +0 −75 src/test/java/nu/mine/mosher/time/TimeTest.java
View
30 pom.xml
@@ -35,19 +35,6 @@
<finalName>genealogy</finalName>
<plugins>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>javacc-maven-plugin</artifactId>
- <version>2.6</version>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <goals>
- <goal>javacc</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
@@ -122,6 +109,11 @@
</build>
<dependencies>
<dependency>
+ <groupId>nu.mine.mosher.gedcom</groupId>
+ <artifactId>gedcom-lib</artifactId>
+ <version>[1.0.0-SNAPSHOT,)</version>
+ </dependency>
+ <dependency>
<groupId>net.sourceforge.templat</groupId>
<artifactId>templat</artifactId>
<version>[1.0,)</version>
@@ -132,17 +124,5 @@
<version>6.0</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
- <version>1.2.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.10</version>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
@@ -1,238 +0,0 @@
-package nu.mine.mosher.collection;
-
-
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-
-
-/**
- * Represents a node in a tree, and the (sub-)tree rooted at that node.
- * @author Chris Mosher
- * @param <T> type of object in each node
- */
-public class TreeNode<T> implements Iterable<TreeNode<T>>
-{
- private T object;
-
- private TreeNode<T> parent;
- private final List<TreeNode<T>> children = new ArrayList<>();
-
- /**
- * Constructs a node, with no children, and no wrapped object.
- */
- public TreeNode()
- {
- this(null);
- }
-
- /**
- * Constructs a node, with no children, and the given wrapped object.
- * @param object the object that this node will wrap
- */
- public TreeNode(final T object)
- {
- this.object = object;
- }
-
- /**
- * Returns the object this node wraps, as passed in to the constructor.
- * Returns <code>null</code> if this node does not wrap an object.
- * @return the wrapped object
- */
- public T getObject()
- {
- return this.object;
- }
-
- /**
- * Sets (or resets) the object this node wraps.
- * @param object the object that this node will wrap
- */
- public void setObject(final T object)
- {
- this.object = object;
- }
-
- /**
- * Gets the (immediate) children of this node, as an iterator.
- * @return iterator of immediate children
- */
- public Iterator<TreeNode<T>> children()
- {
- return this.children.iterator();
- }
-
- /**
- * Gets the count of (immediate) children of this node.
- * @return the count of immediate children
- */
- public int getChildCount()
- {
- return this.children.size();
- }
-
- /**
- * Adds a child to this node. The given child will be removed from any
- * parent it may have.
- * @param child the child to add
- */
- public void addChild(final TreeNode<T> child)
- {
- if (child.parent != null)
- {
- child.removeFromParent();
- }
-
- this.children.add(child);
- child.parent = this;
- }
-
- /**
- * Indicates the attempt to remove a child of a node, when that child is not
- * actually a child of the node.
- * @author Chris Mosher
- */
- public static class NotChild extends Exception
- {
- private NotChild(final TreeNode<?> node, final TreeNode<?> child)
- {
- super("given TreeNode (" + child + ") is not a child of this TreeNode (" + node + ")");
- }
- }
-
- /**
- * Removes the given child from this node.
- * @param child the child to remove
- * @throws NotChild if this given <code>child</code> is not a child of this node
- */
- @SuppressWarnings("synthetic-access")
- public void removeChild(final TreeNode<T> child) throws NotChild
- {
- if (child.parent != this)
- {
- throw new NotChild(this, child);
- }
-
- for (final Iterator<TreeNode<T>> i = children(); i.hasNext();)
- {
- final TreeNode<T> childN = i.next();
- if (childN == child)
- {
- i.remove();
- child.parent = null;
- }
- }
- }
-
- /**
- * Gets this node's parent, if any.
- * @return this node's parent, or <code>null</code> if this node has no
- * parent.
- */
- public TreeNode<T> parent()
- {
- return this.parent;
- }
-
- /**
- * Removes this node from any parent it may have. If this node does not have
- * a parent, then this method just returns without doing anything.
- */
- public void removeFromParent()
- {
- if (this.parent == null)
- {
- return;
- }
-
- try
- {
- this.parent.removeChild(this);
- }
- catch (final NotChild e)
- {
- throw new IllegalStateException(e);
- }
- }
-
- /**
- * Returns what this node's wrapped object's <code>toString</code> method
- * returns, or "[null]" if this node does not have a parent
- * @return same as wrapped object's <code>toString</code>, or "[null]"
- */
- @Override
- public String toString()
- {
- final StringBuilder sb = new StringBuilder();
- try
- {
- appendStringShallow(sb);
- }
- catch (final IOException e)
- {
- throw new IllegalStateException(e);
- }
- return sb.toString();
- }
-
- /**
- * Builds an outline-style string representation of the tree rooted at this
- * node, and appends it to the given <code>Appendable</code>
- * @param appendTo <code>Appendable</code> to append the tree to
- * @throws IOException if an I/O exception occurs while appending to
- * <code>appendTo</code>
- */
- public void appendStringDeep(final Appendable appendTo) throws IOException
- {
- appendStringDeep(appendTo, 0);
- }
-
- private void appendStringDeep(final Appendable appendTo, final int level) throws IOException
- {
- for (int i = 0; i < level; ++i)
- {
- appendTo.append(" ");
- }
-
- appendStringShallow(appendTo);
- appendTo.append("\n");
-
- for (final TreeNode<T> child : this.children)
- {
- child.appendStringDeep(appendTo, level + 1);
- }
- }
-
- /**
- * Builds the same string as {@link TreeNode#toString}, and appends it to
- * the given <code>Appendable</code>
- * @param appendTo <code>Appendable</code> to append the string to
- * @throws IOException if an I/O exception occurs while appending to
- * <code>appendTo</code>
- */
- public void appendStringShallow(final Appendable appendTo) throws IOException
- {
- if (this.object != null)
- {
- appendTo.append(this.object.toString());
- }
- else
- {
- appendTo.append("[null]");
- }
- }
-
- /**
- * Same as {@link TreeNode#children()}
- * @return iterator of immediate children
- */
- @Override
- public Iterator<TreeNode<T>> iterator()
- {
- return children();
- }
-}
Oops, something went wrong.

0 comments on commit 64f7730

Please sign in to comment.