Reformat whole codebase using Android Studio
This commit is contained in:
parent
d5322667d5
commit
c15913c1ab
161 changed files with 15124 additions and 18537 deletions
|
|
@ -7,52 +7,39 @@ import java.io.IOException;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Area
|
||||
{
|
||||
private List<Polygon> poslist = new ArrayList<Polygon>();
|
||||
private List<Polygon> neglist = new ArrayList<Polygon>();
|
||||
public class Area {
|
||||
private List<Polygon> poslist = new ArrayList<Polygon>();
|
||||
private List<Polygon> neglist = new ArrayList<Polygon>();
|
||||
|
||||
public static void main( String[] args ) throws IOException
|
||||
{
|
||||
Area a = new Area( new File( args[0] ) );
|
||||
|
||||
System.out.println( args[1] + " is in " + args[0] + "=" + a.isInArea( Long.parseLong( args[1] ) ) );
|
||||
public static void main(String[] args) throws IOException {
|
||||
Area a = new Area(new File(args[0]));
|
||||
|
||||
System.out.println(args[1] + " is in " + args[0] + "=" + a.isInArea(Long.parseLong(args[1])));
|
||||
}
|
||||
|
||||
public Area( File f ) throws IOException
|
||||
{
|
||||
BufferedReader br = new BufferedReader( new FileReader( f ) );
|
||||
|
||||
public Area(File f) throws IOException {
|
||||
BufferedReader br = new BufferedReader(new FileReader(f));
|
||||
br.readLine();
|
||||
|
||||
for(;;)
|
||||
{
|
||||
|
||||
for (; ; ) {
|
||||
String head = br.readLine();
|
||||
if ( head == null || "END".equals( head ) )
|
||||
{
|
||||
if (head == null || "END".equals(head)) {
|
||||
break;
|
||||
}
|
||||
Polygon pol = new Polygon( br );
|
||||
if ( head.startsWith( "!" ) )
|
||||
{
|
||||
neglist.add( pol );
|
||||
}
|
||||
else
|
||||
{
|
||||
poslist.add( pol );
|
||||
Polygon pol = new Polygon(br);
|
||||
if (head.startsWith("!")) {
|
||||
neglist.add(pol);
|
||||
} else {
|
||||
poslist.add(pol);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isInArea( long id )
|
||||
{
|
||||
for( int i=0; i<poslist.size(); i++)
|
||||
{
|
||||
if ( poslist.get(i).isInPolygon( id ) )
|
||||
{
|
||||
for( int j=0; j<neglist.size(); j++)
|
||||
{
|
||||
if ( neglist.get(j).isInPolygon( id ) )
|
||||
{
|
||||
|
||||
public boolean isInArea(long id) {
|
||||
for (int i = 0; i < poslist.size(); i++) {
|
||||
if (poslist.get(i).isInPolygon(id)) {
|
||||
for (int j = 0; j < neglist.size(); j++) {
|
||||
if (neglist.get(j).isInPolygon(id)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -62,12 +49,9 @@ public class Area
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean isInBoundingBox( long id )
|
||||
{
|
||||
for( int i=0; i<poslist.size(); i++)
|
||||
{
|
||||
if ( poslist.get(i).isInBoundingBox( id ) )
|
||||
{
|
||||
public boolean isInBoundingBox(long id) {
|
||||
for (int i = 0; i < poslist.size(); i++) {
|
||||
if (poslist.get(i).isInBoundingBox(id)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue