public class B extends A{ public B() { super(new XYZ()); } } public abstract class A{ X a; public A(X a){ this.a = a; a.addChangeListener(); } }
Class XYZ{ public static void functionTest(){ // Your code } public static void main(String args[]){ XYZ x = new XYZ(); //Here we can execute the method functionTest() in 2 ways. x.functionTest(); XYZ.functionTest(); } }
XYZ x = new XYZ(); x.setVisible(true); this.dispose(); // use this line if you wish to close the first frame with buttons.
XYZ testXYZ = new XYZ(); System.out.println("testXYZ 0 - " + testXYZ.getTestUrl( 0 ).getId()); System.out.println("testXYZ 1 - " + testXYZ.getTestUrl( 1 ).getId());
/** * Sets a range of zoomlevels. * * @param minZoomLevel minimum zoomlevel * @param maxZoomLevel maximum zoomlevel */ public void setZoomLevelRange(int minZoomLevel, int maxZoomLevel) { setZoomOffset(minZoomLevel); int len = maxZoomLevel - minZoomLevel + 1; double[] resolutions = new double[len]; double curRes = getGroundResolutionInMeters(0, minZoomLevel); for (int i = 0; i < len; i++) { resolutions[i] = curRes; curRes = curRes / 2; } // resolution setting seems to work only via options XYZOptions options = new XYZOptions(); options.setResolutions(resolutions); this.addOptions(options); }
/** * Determines the ground resolution (in meters per pixel) at a specified * latitude and level of detail. * * @param latitude latitude * @param zoomLevel zoomlevel * @return ground resolution */ public static double getGroundResolutionInMeters(double latitude, int zoomLevel) { return Math.cos(latitude * Math.PI / 180) * 2 * Math.PI * dEarthRadius / getMapSizeInPixels( zoomLevel); }
/** * If your cache has more zoom levels than you want to provide access to * with this layer, supply a zoomOffset. This zoom offset is added to the * current map zoom level to determine the level for a requested tile. For * example, if you supply a zoomOffset of 3, when the map is at the zoom 0, * tiles will be requested from level 3 of your cache. Default is 0 (assumes * cache level and map zoom are equivalent). Using zoomOffset is an * alternative to setting serverResolutions if you only want to expose a * subset of the server resolutions. * * @param zoomOffset zoom offset */ public void setZoomOffset(int zoomOffset) { XYZImpl.setZoomOffset(this.getJSObject(), zoomOffset); }
public L createLayer(JSObject jsObject) { return (L) new XYZ(jsObject); } };
methodA{ doSomething(abc, def, function(obj){ $.when(callback(new XYZ())).then(obj.getName()); });
XYZ xyz = new XYZ(); xyz.setStatus(10); getSession().merge(xyz);
public XYZ narrowToXYZ(JSObject xyzLayer){ return (xyzLayer == null)?null:new XYZ(xyzLayer); }
XYZ bean = new XYZ(); context.getAutowireCapableBeanFactory().autowireBean(bean);
function XYZ(date, startT) { this._date = date; this._startT = startT; } XYZ.prototype.get_date = function() { return this._date; } XYZ.prototype.set_date = function(value) { this._date = value; } XYZ.prototype.get_startT = function() { return this._startT; } XYZ.prototype.set_startT = function(value) { this._startT = value; } XYZ.prototype.toString = function() { return this._date + " " + this._startT; } var myXYZ = new XYZ("2012-11-11","8:00"); myXYZ.toString(); // "2012-11-11 8:00"
class A<T extends X & Y> { public void display(T t){ t.eat(); t.drink(); System.out.println("Type of T is "+t.getClass().getName()); } } public static void main(String[] args) { A<XYZ> a=new A<>(); a.display(new XYZ()); }
ABC abc = new ABC(); XYZ xyz = new XYZ(); if(i==1) { ROOTPanel.get("panel").add(abc); } else { ROOTPanel.get("panel").add(xyz); } if(ROOTPanel.get("panel").getWidgetIndex(abc) != -1) { // You know ABC was added }
// object Factory Method private XYZ getXYZInstance(){ XYZ objXYZ = new XYZ(); // initialization } // Your Code List XYZList = new ArrayList<XYZ>(); for(i=0;i<10;i++){ XYZList.add(getXYZInstance()); }
public XYZ getFinalValue(ABC obj) { int finalValue = 0; //go inside, look for it's value. //return that values if obj has no children. //If Obj has a child, accumulate Its value with it's children value finalValue = obj.getValue(); if(obj.getChidlren().size() > 0) { for(ABC ob:obj.getChidlren()) { finalValue += getFinalValue(ob); } } return new XYZ(finalValue); }