Browse Source

Refactoring

tags/Beta
Janis 10 months ago
parent
commit
f9c7907c19
16 changed files with 35 additions and 50 deletions
  1. +0
    -8
      .classpath
  2. +0
    -30
      .project
  3. +12
    -0
      Cafe_Collector.iml
  4. +4
    -0
      src/app/pott/kaffeepott/collector/Constants.kt
  5. +1
    -1
      src/app/pott/kaffeepott/collector/core/Badge.kt
  6. +2
    -1
      src/app/pott/kaffeepott/collector/core/Ticket.kt
  7. +5
    -0
      src/app/pott/kaffeepott/collector/core/WeekTime.kt
  8. +3
    -0
      src/app/pott/kaffeepott/collector/core/WeekTimeRange.kt
  9. +1
    -1
      src/app/pott/kaffeepott/collector/osmweb/DBAdapter.kt
  10. +1
    -2
      src/app/pott/kaffeepott/collector/osmweb/QueryBuilder.kt
  11. +1
    -2
      src/app/pott/kaffeepott/collector/osmweb/parser/AccessibleMatcher.kt
  12. +1
    -1
      src/app/pott/kaffeepott/collector/osmweb/parser/BadgeMatcher.kt
  13. +1
    -1
      src/app/pott/kaffeepott/collector/osmweb/parser/BadgeMatchers.kt
  14. +1
    -1
      src/app/pott/kaffeepott/collector/osmweb/parser/ResultParser.kt
  15. +1
    -1
      src/app/pott/kaffeepott/collector/osmweb/parser/SAXContentHandler.kt
  16. +1
    -1
      src/app/pott/kaffeepott/collector/osmweb/parser/WiFiMatcher.kt

+ 0
- 8
.classpath View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.jetbrains.kotlin.core.KOTLIN_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>

+ 0
- 30
.project View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Cafe-Collector</name>
<comment>Cafe-Collector</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.jetbrains.kotlin.ui.kotlinBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.jetbrains.kotlin.core.kotlinNature</nature>
</natures>
<linkedResources>
<link>
<name>kotlin_bin</name>
<type>2</type>
<locationURI>org.jetbrains.kotlin.core.filesystem:/Test/kotlin_bin</locationURI>
</link>
</linkedResources>
</projectDescription>

+ 12
- 0
Cafe_Collector.iml View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
</component>
</module>

+ 4
- 0
src/app/pott/kaffeepott/collector/Constants.kt View File

@@ -24,5 +24,9 @@ class Constants {
object BadgeConstants {
const val INTERNET_KEY = "internet_access"
const val WIFI_VALUE = "wlan"

const val ACCESSIBLE_KEY = "wheelchair"

const val YES_VALUE = "yes"
}
}

src/app/pott/kaffeepott/collector/reporter/Badge.kt → src/app/pott/kaffeepott/collector/core/Badge.kt View File

@@ -1,4 +1,4 @@
package app.pott.kaffeepott.collector.reporter
package app.pott.kaffeepott.collector.core

enum class Badge {
WIFI, FAIRTRADE, SEATING, ACCESSIBLE, ORGANIC

src/app/pott/kaffeepott/collector/reporter/Ticket.kt → src/app/pott/kaffeepott/collector/core/Ticket.kt View File

@@ -1,5 +1,6 @@
package app.pott.kaffeepott.collector.reporter
package app.pott.kaffeepott.collector.core

import app.pott.kaffeepott.collector.core.Badge
import app.pott.kaffeepott.collector.core.LatLng

class Ticket(var name: String? = null, var location: LatLng? = null) {

+ 5
- 0
src/app/pott/kaffeepott/collector/core/WeekTime.kt View File

@@ -0,0 +1,5 @@
package app.pott.kaffeepott.collector.core

import java.time.DayOfWeek

data class WeekTime(val dayOfWeek: DayOfWeek, val hourOfDay: Int, val minuteOfHour: Int)

+ 3
- 0
src/app/pott/kaffeepott/collector/core/WeekTimeRange.kt View File

@@ -0,0 +1,3 @@
package app.pott.kaffeepott.collector.core

data class WeekTimeRange(val begin: WeekTime, val end: WeekTime)

+ 1
- 1
src/app/pott/kaffeepott/collector/osmweb/DBAdapter.kt View File

@@ -3,7 +3,7 @@ package app.pott.kaffeepott.collector.osmweb
import app.pott.kaffeepott.collector.Constants
import app.pott.kaffeepott.collector.core.LatLngBounds
import app.pott.kaffeepott.collector.osmweb.parser.ResultParser
import app.pott.kaffeepott.collector.reporter.Ticket
import app.pott.kaffeepott.collector.core.Ticket
import java.io.BufferedReader
import java.io.IOException
import java.net.HttpURLConnection


+ 1
- 2
src/app/pott/kaffeepott/collector/osmweb/QueryBuilder.kt View File

@@ -2,9 +2,8 @@ package app.pott.kaffeepott.collector.osmweb

import app.pott.kaffeepott.collector.Constants
import app.pott.kaffeepott.collector.core.LatLngBounds
import java.net.URL
import java.net.URI
import java.net.URLEncoder
import java.net.URL

class QueryBuilder {



+ 1
- 2
src/app/pott/kaffeepott/collector/osmweb/parser/AccessibleMatcher.kt View File

@@ -1,8 +1,7 @@
package app.pott.kaffeepott.collector.osmweb.parser

import app.pott.kaffeepott.collector.Constants
import app.pott.kaffeepott.collector.reporter.Badge
import java.net.URI
import app.pott.kaffeepott.collector.core.Badge

class AccessibleMatcher : BadgeMatcher {


+ 1
- 1
src/app/pott/kaffeepott/collector/osmweb/parser/BadgeMatcher.kt View File

@@ -1,6 +1,6 @@
package app.pott.kaffeepott.collector.osmweb.parser

import app.pott.kaffeepott.collector.reporter.Badge
import app.pott.kaffeepott.collector.core.Badge

interface BadgeMatcher {
val badge: Badge


+ 1
- 1
src/app/pott/kaffeepott/collector/osmweb/parser/BadgeMatchers.kt View File

@@ -1,6 +1,6 @@
package app.pott.kaffeepott.collector.osmweb.parser

import app.pott.kaffeepott.collector.reporter.Badge
import app.pott.kaffeepott.collector.core.Badge

class BadgeMatchers(private val matchers: List<BadgeMatcher>) {



+ 1
- 1
src/app/pott/kaffeepott/collector/osmweb/parser/ResultParser.kt View File

@@ -1,6 +1,6 @@
package app.pott.kaffeepott.collector.osmweb.parser

import app.pott.kaffeepott.collector.reporter.Ticket
import app.pott.kaffeepott.collector.core.Ticket
import org.xml.sax.InputSource
import java.io.StringReader
import javax.xml.parsers.SAXParserFactory


+ 1
- 1
src/app/pott/kaffeepott/collector/osmweb/parser/SAXContentHandler.kt View File

@@ -2,7 +2,7 @@ package app.pott.kaffeepott.collector.osmweb.parser

import app.pott.kaffeepott.collector.Constants
import app.pott.kaffeepott.collector.core.LatLng
import app.pott.kaffeepott.collector.reporter.Ticket
import app.pott.kaffeepott.collector.core.Ticket
import org.xml.sax.Attributes
import org.xml.sax.helpers.DefaultHandler



+ 1
- 1
src/app/pott/kaffeepott/collector/osmweb/parser/WiFiMatcher.kt View File

@@ -1,7 +1,7 @@
package app.pott.kaffeepott.collector.osmweb.parser

import app.pott.kaffeepott.collector.Constants
import app.pott.kaffeepott.collector.reporter.Badge
import app.pott.kaffeepott.collector.core.Badge

class WiFiMatcher : BadgeMatcher {
override val badge: Badge = Badge.WIFI


Loading…
Cancel
Save