input
stringlengths
10
828
output
stringlengths
5
107
public boolean is intersects return is disjoint
returns code true code if code is disjoint code returns false
protected void geometry changed action envelope null
notifies this geometry that its coordinates have been changed by an external
public void set to null minx 0 maxx 1 miny 0 maxy 1
makes this code envelope code a null envelope that is the envelope
public boolean is within return matches matrix location interior location interior t matrix location interior location exterior dimension false matrix location boundary location exterior dimension false
tests whether this code intersection matrix code is
public boolean is null return maxx minx
returns code true code if this code envelope code is a null
public double get width if is null return 0 return maxx minx
returns the difference between the maximum and minimum x values
public boolean disjoint geometry g return intersects g
tests whether this geometry is disjoint from the specified geometry
public boolean is contains return matches matrix location interior location interior t matrix location exterior location interior dimension false matrix location exterior location boundary dimension false
tests whether this code intersection matrix code is
public double get height if is null return 0 return maxy miny
returns the difference between the maximum and minimum y values
public boolean is covers boolean has point in common matches matrix location interior location interior t matches matrix location interior location boundary t matches matrix location boundary location interior t matches matrix location boundary location boundary t return has point in common matrix location exterior location interior dimension false matrix location exterior location boundary dimension false
returns code true code if this code intersection matrix code is
public boolean is covered by boolean has point in common matches matrix location interior location interior t matches matrix location interior location boundary t matches matrix location boundary location interior t matches matrix location boundary location boundary t return has point in common matrix location interior location exterior dimension false matrix location boundary location exterior dimension false
returns code true code if this code intersection matrix code is
public boolean touches geometry g short circuit test if get envelope internal intersects g get envelope internal return false return relate g is touches get dimension g get dimension
tests whether this geometry touches the
public boolean is equals int dimension of geometry a int dimension of geometry b if dimension of geometry a dimension of geometry b return false return matches matrix location interior location interior t matrix location exterior location interior dimension false matrix location interior location exterior dimension false matrix location exterior location boundary dimension false matrix location boundary location exterior dimension false
returns code true code if this code intersection matrix code is
public boolean is overlaps int dimension of geometry a int dimension of geometry b if dimension of geometry a dimension p dimension of geometry b dimension p dimension of geometry a dimension a dimension of geometry b dimension a return matches matrix location interior location interior t matches matrix location interior location exterior t matches matrix location exterior location interior t if dimension of geometry a dimension l dimension of geometry b dimension l return matrix location interior location interior 1 matches matrix location interior location exterior t matches matrix location exterior location interior t return false
returns code true code if this code intersection matrix code is
public boolean matches string required dimension symbols if required dimension symbols length 9 throw new illegal argument exception should be length 9 required dimension symbols for int ai 0 ai 3 ai for int bi 0 bi 3 bi if matches matrix ai bi required dimension symbols char at 3 ai bi return false return true
returns whether the elements of this code intersection matrix code
public void expand to include double x double y if is null minx x maxx x miny y maxy y else if x minx minx x if x maxx maxx x if y miny miny y if y maxy maxy y
enlarges this code envelope code so that it contains
public intersection matrix transpose int temp matrix 1 0 matrix 1 0 matrix 0 1 matrix 0 1 temp temp matrix 2 0 matrix 2 0 matrix 0 2 matrix 0 2 temp temp matrix 2 1 matrix 2 1 matrix 1 2 matrix 1 2 temp return this
transposes this intersection matrix
public void expand to include envelope other if other is null return if is null minx other get min x maxx other get max x miny other get min y maxy other get max y else if other minx minx minx other minx if other maxx maxx maxx other maxx if other miny miny miny other miny if other maxy maxy maxy other maxy
enlarges this code envelope code so that it contains
public void translate double trans x double trans y if is null return init get min x trans x get max x trans x get min y trans y get max y trans y
translates this envelope by given amounts in the x and y direction
public boolean crosses geometry g short circuit test if get envelope internal intersects g get envelope internal return false return relate g is crosses get dimension g get dimension
tests whether this geometry crosses the
protected coordinate get coordinate int n return point geometries n get coordinate
returns the code coordinate code at the given position
public boolean intersects envelope other if is null other is null return false return other minx maxx other maxx minx other miny maxy other maxy miny
check if the region defined by code other code
public boolean within geometry g return g contains this
tests whether this geometry is within the
public boolean intersects coordinate p return intersects p x p y
check if the point code p code
public boolean intersects double x double y if is null return false return x maxx x minx y maxy y miny
check if the point code x y code
public boolean contains geometry g short circuit test if get envelope internal contains g get envelope internal return false optimization for rectangle arguments if is rectangle return rectangle contains contains polygon this g general case return relate g is contains
tests whether this geometry contains the
public boolean contains envelope other return covers other
tests if the code envelope other code
public boolean contains coordinate p return covers p
tests if the given point lies in or on the envelope
public boolean contains double x double y return covers x y
tests if the given point lies in or on the envelope
public boolean covers double x double y if is null return false return x minx x maxx y miny y maxy
tests if the given point lies in or on the envelope
public boolean overlaps geometry g short circuit test if get envelope internal intersects g get envelope internal return false return relate g is overlaps get dimension g get dimension
tests whether this geometry overlaps the
public boolean covers coordinate p return covers p x p y
tests if the given point lies in or on the envelope
public boolean covers envelope other if is null other is null return false return other get min x minx other get max x maxx other get min y miny other get max y maxy
tests if the code envelope other code
public boolean covers geometry g short circuit test if get envelope internal covers g get envelope internal return false optimization for rectangle arguments if is rectangle since we have already tested that the test envelope is covered return true return relate g is covers
tests whether this geometry covers the
public boolean covered by geometry g return g covers this
tests whether this geometry is covered by the
public boolean relate geometry g string intersection pattern return relate g matches intersection pattern
tests whether the elements in the de 9 im
public boolean has intersection return has intersection
tests whether an intersection was found
public boolean has proper intersection return has proper intersection
tests whether a proper intersection was found
public boolean has non proper intersection return has non proper intersection
tests whether a non proper intersection was found
public coordinate get intersection return int pt
gets the computed location of the intersection
public intersection matrix relate geometry g check not geometry collection this check not geometry collection g return relate op relate this g
returns the de 9 im
public boolean has intersection return interior intersection null
tests whether an intersection was found
public coordinate get interior intersection return interior intersection
gets the computed location of the intersection
public boolean equals geometry g short circuit test if get envelope internal equals g get envelope internal return false return relate g is equals get dimension g get dimension
tests whether this geometry is equal to the
public int get dimension return max dimension to read
gets the maximum number of coordinate dimensions which will be read
public void set dimension int dimension this max dimension to read dimension
sets the maximum number of coordinate dimensions to read
public string to text wktwriter writer new wktwriter return writer write this
returns the well known text representation of this code geometry code
private int elem info etype geometry geom switch template geom case constants sdo gtemplate point return constants sdo etype point case constants sdo gtemplate line return constants sdo etype line case constants sdo gtemplate polygon jts convention return constants sdo etype polygon exterior cc order default should never happen throw new illegal argument exception unknown encoding of sdo gtemplate
produce code sdo etype code for geometry description as stored in the
public geometry buffer double distance return buffer op buffer op this distance
computes a buffer area around this geometry having the given width
private int g type geometry geom int d dimension geom 1000 int l lrs geom 100 int tt template geom return d l tt
produce sdo gtemplate representing provided geometry
public geometry buffer double distance int quadrant segments return buffer op buffer op this distance quadrant segments
computes a buffer area around this geometry having the given width and with
private int dimension geometry geom int d double is na n geom get coordinate z 2 3 return d dimension d dimension
return dimensions as defined by sdo gtemplate either 2 3 or 4
protected oracle connection get connection return connection
sub classes should not assume that either the connection will always exist or
private int lrs geometry geom when measures are supported this may change until then return 0
return lrs as defined by sdo gtemplate either 3 4 or 0
public geometry buffer double distance int quadrant segments int end cap style return buffer op buffer op this distance quadrant segments end cap style
computes a buffer area around this geometry having the given
public void test single point round trip throws sqlexception point generator pg new point generator pg set geometry factory geometry factory pg set bounding box new envelope 0 10 0 10 point pt point pg create ora writer ow new ora writer get connection struct st ow write pt ora reader or new ora reader point pt2 point or read st system out println pt null null pt to string system out println pt2 null null pt2 to string assert true the input point is not the same as the output point pt equals pt2
round trip test for a single point
public geometry convex hull return new convex hull this get convex hull
computes the smallest convex code polygon code that contains all the
private coordinate sequence sub list coordinate sequence factory factory coordinate sequence coords int start int end if start 0 end coords size return coords if coords instanceof list list sublist list coords sub list start end if sublist instanceof coordinate sequence return coordinate sequence sublist coordinate list list new coordinate list coords to coordinate array coordinate array new coordinate end start int index 0 for iterator i list sub list start end iterator i has next index array index coordinate i next return factory create array
version of list
private number to number double number throws sqlexception if double is na n number return null return new number number
convience method for number construction
private int e type int elem info int triplet index if triplet index 3 1 elem info length return 1 return elem info triplet index 3 1
etype access for the elem info triplet indicated
private coordinate sequence reverse coordinate sequence factory factory coordinate sequence sequence coordinate list list new coordinate list sequence to coordinate array collections reverse list return factory create list to coordinate array
reverses the coordinate order
private int interpretation int elem info int triplet index if triplet index 3 2 elem info length return 1 return elem info triplet index 3 2
accesses the interpretation value for the current geometry
public void test single point round trip throws saxexception ioexception parser configuration exception point generator pg new point generator pg set geometry factory geometry factory pg set bounding box new envelope 0 10 0 10 point pt point pg create gmlwriter out new gmlwriter out set prefix null out write pt get writer gmlreader in new gmlreader point pt2 point in read get reader geometry factory system out println pt null null pt to string system out println pt2 null null pt2 to string assert true the input point is not the same as the output point pt equals pt2
round trip test for a single point
public void test single polygon no hole round trip throws ioexception saxexception parser configuration exception polygon generator pg new polygon generator pg set geometry factory geometry factory pg set bounding box new envelope 0 10 0 10 pg set number points 10 polygon pt polygon pg create gmlwriter out new gmlwriter out set prefix out write pt get writer gmlreader in new gmlreader polygon pt2 polygon in read get reader geometry factory assert true the input polygon is not the same as the output polygon pt equals pt2
round trip test for a single polygon
public void test single polygon many points no hole round trip throws ioexception saxexception parser configuration exception polygon generator pg new polygon generator pg set geometry factory geometry factory pg set bounding box new envelope 0 10 0 10 pg set generation algorithm polygon generator box pg set number points 1000 polygon pt polygon pg create gmlwriter out new gmlwriter out set prefix out write pt get writer gmlreader in new gmlreader polygon pt2 polygon in read get reader geometry factory assert true the input polygon is not the same as the output polygon pt equals pt2
round trip test for a single polygon with lotsa points
public void test single polygon holes round trip throws saxexception ioexception parser configuration exception polygon generator pg new polygon generator pg set geometry factory geometry factory pg set bounding box new envelope 0 10 0 10 pg set number points 10 pg set number holes 4 polygon pt polygon pg create gmlwriter out new gmlwriter out set prefix out write pt get writer gmlreader in new gmlreader polygon pt2 polygon in read get reader geometry factory system out println pt system out println pt2 assert true the input polygon is not the same as the output polygon pt equals pt2
round trip test for a single polygon
private int starting offset int elem info int triplet index if triplet index 3 0 elem info length return 1 return elem info triplet index 3 0
accesses the starting index in the ordinate array for the current geometry
public int convert to x int resolution float min long float max long return math round resolution longitude min long
crappy function for simple bitmaps
public geometry get state area area pb geometry convex hull return area
returns the states boundary
public geometry union return unary union op union this
computes the union of all the elements of this geometry
public object clone try geometry clone geometry super clone if clone envelope null clone envelope new envelope clone envelope return clone catch clone not supported exception e assert should never reach here return null
creates and returns a full copy of this
public int compare to object o geometry other geometry o if get class sort index other get class sort index return get class sort index other get class sort index if is empty other is empty return 0 if is empty return 1 if other is empty return 1 return compare to same class o
returns whether this code geometry code is greater than equal to
public int compare to object o coordinate sequence comparator comp geometry other geometry o if get class sort index other get class sort index return get class sort index other get class sort index if is empty other is empty return 0 if is empty return 1 if other is empty return 1 return compare to same class o comp
returns whether this code geometry code is greater than equal to
protected boolean is equivalent class geometry other return this get class get name equals other get class get name
returns whether the two code geometry code s are equal from the point
protected int compare collection a collection b iterator i a iterator iterator j b iterator while i has next j has next comparable a element comparable i next comparable b element comparable j next int comparison a element compare to b element if comparison 0 return comparison if i has next return 1 if j has next return 1 return 0
returns the first non zero result of code compare to code encountered as
private jtext field get jtext field if j text field null j text field new jtext field j text field set bounds new rectangle 67 6 418 19 j text field set text return j text field
this method initializes j text field
private jbutton get jbutton if j button null j button new jbutton j button set text buscar j button set bounds new rectangle 613 6 84 22 return j button
this method initializes j button
private jpanel get jpanel3 if j panel3 null j panel3 new jpanel j panel3 set layout new flow layout j panel3 set bounds new rectangle 586 554 387 35 j panel3 add get jbutton1 null j panel3 add get jbutton2 null j panel3 add get jbutton3 null return j panel3
this method initializes j panel3
private jbutton get jbutton1 if j button1 null j button1 new jbutton j button1 set text guardar return j button1
this method initializes j button1
private jbutton get jbutton2 if j button2 null j button2 new jbutton j button2 set text leer return j button2
this method initializes j button2
private jbutton get jbutton3 if j button3 null j button3 new jbutton j button3 set text reproducir return j button3
this method initializes j button3
private jpanel get jpanel31 if j panel31 null j panel31 new jpanel j panel31 set layout new flow layout j panel31 set bounds new rectangle 148 554 264 35 j panel31 add get jbutton11 null j panel31 add get jbutton21 null j panel31 add get jbutton31 null return j panel31
this method initializes j panel31
private jbutton get jbutton11 if j button11 null j button11 new jbutton j button11 set text agregar j button11 add mouse listener new java awt event mouse adapter public void mouse clicked java awt event mouse event e new songs frame new insert new songs new songs frame set always on top true new songs frame set modal true new songs frame set visible true return j button11
this method initializes j button11
private jbutton get jbutton21 if j button21 null j button21 new jbutton j button21 set text borrar return j button21
this method initializes j button21
private jbutton get jbutton31 if j button31 null j button31 new jbutton j button31 set text modificar return j button31
this method initializes j button31
private jcombo box get jcombo box if j combo box null j combo box new jcombo box j combo box add item artista j combo box add item cancion j combo box set bounds new rectangle 492 6 112 19 return j combo box
this method initializes j combo box
private jframe get jframe if j frame null j frame new jframe j frame set default close operation jframe exit on close j frame set jmenu bar get jjmenu bar j frame set size 997 688 j frame set content pane get jcontent pane j frame set title lyrics manager return j frame
this method initializes j frame
private jpanel get jcontent pane if j content pane null j label new jlabel j label set text nombre j label set bounds new rectangle 4 6 59 15 j content pane new jpanel j content pane set layout null j content pane add get jpanel null j content pane add get jpanel1 null j content pane add get jpanel2 null j content pane add get jpanel3 null j content pane add get jpanel31 null return j content pane
this method initializes j content pane
private jmenu get file menu if file menu null file menu new jmenu file menu set text file file menu set mnemonic key event vk undefined file menu add get save menu item file menu add get exit menu item return file menu
this method initializes j menu
private jpanel get jcontent pane if j content pane null j content pane new jpanel j content pane set layout null j content pane add get jpanel null j content pane add get jpanel1 null j content pane add get jpanel2 null j content pane add get jpanel3 null j content pane add get jpanel4 null return j content pane
this method initializes j content pane
private jpanel get jpanel if j panel null j label new jlabel j label set text nombre j panel new jpanel j panel set layout new border layout j panel set size new dimension 633 18 j panel set location new point 16 15 j panel add j label border layout west j panel add get jtext field border layout center return j panel
this method initializes j panel
private jtext field get jtext field if j song name null j song name new jtext field return j song name
this method initializes j text field
private jpanel get jpanel1 if j panel1 null j label1 new jlabel j label1 set text artista j panel1 new jpanel j panel1 set layout new border layout j panel1 set bounds new rectangle 16 46 328 18 j panel1 set preferred size new dimension 0 0 j panel1 add j label1 border layout west j panel1 add jget artists combo box border layout center j panel1 add get jnew artist button border layout east return j panel1
this method initializes j panel1
private jpanel get jpanel3 if j panel3 null j panel3 new jpanel j panel3 set layout new flow layout j panel3 set size new dimension 631 42 j panel3 set location new point 16 625 j panel3 set component orientation component orientation unknown j panel3 set border border factory create titled border null titled border default justification titled border default position null null j panel3 add get jbutton null j panel3 add get jbutton1 null j panel3 add get jbutton3 null return j panel3
this method initializes j panel3
private jbutton get jbutton1 if j button1 null j button1 new jbutton j button1 set text limpiar j button1 add mouse listener new java awt event mouse adapter override public void mouse clicked java awt event mouse event e get jtext field set text get jeditor pane set text get jtext field request focus in window return j button1
this method initializes j button1
private jcombo box jget artists combo box if j artist box null j artist box new jcombo box j artist box set editable true return j artist box
this method initializes j combo box
private jpanel get jpanel4 if j panel4 null j label2 new jlabel j label2 set text genero j panel4 new jpanel j panel4 set layout new border layout j panel4 set bounds new rectangle 360 46 287 18 j panel4 add j label2 border layout west j panel4 add jget genre combo box border layout center return j panel4
this method initializes j panel4
private jcombo box jget genre combo box if j genre box null j genre box new jcombo box return j genre box
this method initializes j combo box1
private jbutton get jbutton3 if j button3 null j button3 new jbutton j button3 set text cerrar j button3 add mouse listener new java awt event mouse adapter override public void mouse clicked java awt event mouse event e set visible false return j button3
this method initializes j button3
public boolean accept file f if f is directory f ends with sav return true return false
determines whether or not the current file in the directory is