Skip to content

Commit

Permalink
Refactor: move TWKB classes from package jts.io to jts.io.twkb
Browse files Browse the repository at this point in the history
  • Loading branch information
groldan committed Jul 20, 2019
1 parent d50ee00 commit 90b870b
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.locationtech.jts.io;
package org.locationtech.jts.io.twkb;

import java.io.DataInput;
import java.io.DataOutput;
Expand All @@ -17,7 +17,7 @@
import org.locationtech.jts.geom.MultiPolygon;
import org.locationtech.jts.geom.Point;
import org.locationtech.jts.geom.Polygon;
import org.locationtech.jts.io.TWKBIO.TWKBOutputStream;
import org.locationtech.jts.io.twkb.TWKBIO.TWKBOutputStream;

import lombok.Builder;
import lombok.EqualsAndHashCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
*
* http://www.eclipse.org/org/documents/edl-v10.php.
*/
package org.locationtech.jts.io;
package org.locationtech.jts.io.twkb;

import static org.locationtech.jts.io.TWKBHeader.GeometryType.POINT;
import static org.locationtech.jts.io.twkb.TWKBHeader.GeometryType.POINT;

import java.io.ByteArrayOutputStream;
import java.io.DataInput;
Expand All @@ -36,7 +36,7 @@
import org.locationtech.jts.geom.Point;
import org.locationtech.jts.geom.Polygon;
import org.locationtech.jts.geom.impl.PackedCoordinateSequenceFactory;
import org.locationtech.jts.io.TWKBHeader.GeometryType;
import org.locationtech.jts.io.twkb.TWKBHeader.GeometryType;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* http://www.eclipse.org/org/documents/edl-v10.php.
*/
package org.locationtech.jts.io;
package org.locationtech.jts.io.twkb;

import java.io.ByteArrayInputStream;
import java.io.DataInput;
Expand All @@ -20,6 +20,7 @@

import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.io.ParseException;

public class TWKBReader {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* http://www.eclipse.org/org/documents/edl-v10.php.
*/
package org.locationtech.jts.io;
package org.locationtech.jts.io.twkb;

import java.io.ByteArrayOutputStream;
import java.io.DataOutput;
Expand All @@ -20,7 +20,7 @@
import java.util.Objects;

import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.io.TWKBIO.TWKBOutputStream;
import org.locationtech.jts.io.twkb.TWKBIO.TWKBOutputStream;

/**
* <pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* Original file: https://svn.apache.org/repos/asf/mahout/branches/mahout-0.8/core/src/main/java/org/apache/mahout/math/Varint.java
*/
package org.locationtech.jts.io;
package org.locationtech.jts.io.twkb;

import java.io.DataInput;
import java.io.DataOutput;
Expand All @@ -36,7 +36,7 @@
* "compatible" with variable-length encoding.
* </p>
*/
public final class Varint {
final class Varint {

private Varint() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* http://www.eclipse.org/org/documents/edl-v10.php.
*/
package org.locationtech.jts.io;
package org.locationtech.jts.io.twkb;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
Expand All @@ -22,7 +22,11 @@
import org.junit.Test;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.io.TWKBTestSupport.TWKBTestData;
import org.locationtech.jts.io.ParseException;
import org.locationtech.jts.io.WKTReader;
import org.locationtech.jts.io.twkb.TWKBReader;
import org.locationtech.jts.io.twkb.TWKBWriter;
import org.locationtech.jts.io.twkb.TWKBTestSupport.TWKBTestData;

public class TWKBReadWriteTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* http://www.eclipse.org/org/documents/edl-v10.php.
*/
package org.locationtech.jts.io;
package org.locationtech.jts.io.twkb;

import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
Expand All @@ -24,7 +24,11 @@
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.geom.impl.PackedCoordinateSequenceFactory;
import org.locationtech.jts.io.TWKBTestSupport.TWKBTestData;
import org.locationtech.jts.io.ParseException;
import org.locationtech.jts.io.WKBReader;
import org.locationtech.jts.io.WKTReader;
import org.locationtech.jts.io.twkb.TWKBReader;
import org.locationtech.jts.io.twkb.TWKBTestSupport.TWKBTestData;

/**
* Tests for reading TWKB.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* http://www.eclipse.org/org/documents/edl-v10.php.
*/
package org.locationtech.jts.io;
package org.locationtech.jts.io.twkb;

import static java.nio.charset.StandardCharsets.UTF_8;

Expand All @@ -24,6 +24,9 @@
import org.apache.commons.csv.CSVRecord;
import org.junit.rules.ExternalResource;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.io.ParseException;
import org.locationtech.jts.io.WKBReader;
import org.locationtech.jts.io.WKTReader;

import lombok.Builder;
import lombok.Cleanup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* http://www.eclipse.org/org/documents/edl-v10.php.
*/
package org.locationtech.jts.io;
package org.locationtech.jts.io.twkb;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
Expand All @@ -26,7 +26,11 @@
import org.junit.Rule;
import org.junit.Test;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.io.TWKBTestSupport.TWKBTestData;
import org.locationtech.jts.io.ParseException;
import org.locationtech.jts.io.WKBReader;
import org.locationtech.jts.io.twkb.TWKBHeader;
import org.locationtech.jts.io.twkb.TWKBWriter;
import org.locationtech.jts.io.twkb.TWKBTestSupport.TWKBTestData;

public class TWKBWriterTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
*
* http://www.eclipse.org/org/documents/edl-v10.php.
*/
package org.locationtech.jts.io;
package org.locationtech.jts.io.twkb;

import static org.junit.Assert.assertEquals;
import static org.locationtech.jts.io.Varint.readSignedVarInt;
import static org.locationtech.jts.io.Varint.readSignedVarLong;
import static org.locationtech.jts.io.Varint.readUnsignedVarInt;
import static org.locationtech.jts.io.Varint.readUnsignedVarLong;
import static org.locationtech.jts.io.Varint.writeSignedVarInt;
import static org.locationtech.jts.io.Varint.writeSignedVarLong;
import static org.locationtech.jts.io.Varint.writeUnsignedVarInt;
import static org.locationtech.jts.io.Varint.writeUnsignedVarLong;
import static org.locationtech.jts.io.twkb.Varint.readSignedVarInt;
import static org.locationtech.jts.io.twkb.Varint.readSignedVarLong;
import static org.locationtech.jts.io.twkb.Varint.readUnsignedVarInt;
import static org.locationtech.jts.io.twkb.Varint.readUnsignedVarLong;
import static org.locationtech.jts.io.twkb.Varint.writeSignedVarInt;
import static org.locationtech.jts.io.twkb.Varint.writeSignedVarLong;
import static org.locationtech.jts.io.twkb.Varint.writeUnsignedVarInt;
import static org.locationtech.jts.io.twkb.Varint.writeUnsignedVarLong;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
Expand Down

0 comments on commit 90b870b

Please sign in to comment.