Adapters-shoud i still use "implements or extends" keyword

hi all...especially Mr. Glen McCluskey...
i've just read the TechTips using Adapters-9 May 2000...
there was an example about using adapters...there wasn't keyword "extends or implements" in that example ...
so the question is:
if i use adapters, should i still extend or implements my derived class from base class? or this formula is just enough, for example:
frame.addWindowListener(new WindowAdapter(){................});
the example available at: developer.java.sun.com/developer/TechTips/index.html the date is 9 May 2000 writer:Glen McCluskey ...
thank you, all...

I don't understand why you say "there wasn't keyword "extends or implements" in that example ", I read the article and see:abstract class A_ADAPTER implements A {
        public void f1() {}
        public void f2() {}
        public void f3() {}
        public void f4() {}
        public void f5() {}
    } which clearly implements interface A, and the class that uses this adapter must extend the adapter. So yes, your adapter must implement the interface it is adapting, and the class that is using this adapter must extend the adapter to "use" it.
Lee

Similar Messages

  • How do I use my time capsule as a wifi extender and still use as a backup in Time Machine

    I purchased a new airport extreme and want to use my existing time capsule as a wifi extender in another part of the house.  How do I set this up so that I can still use the time capsule as my backup (time machine) hard drive?

    Hello BNOLTNER,
    Thanks for using Apple Support Communities.
    Please see the directions in the following article for configuring your extended network.  Your Time Capsule will still be seen on the network, and may still be used as a backup destination.
    Wi-Fi base stations: Setting up and configuring an extended wireless network (802.11n)
    http://support.apple.com/kb/HT4259
    Take care,
    Alex H.

  • Can I use Extreme with Time Capsule to extend my gateway router and still use Capsule as "external HD"?

    Bought Airport Extreme with Time Capsule version 7.7.2 with 2 Terabytes Feb 2014. It was probably an expensive mistake, but after searching for weeks for a external hard drive, it seemed reasonably priced to just use the capsule as my external hard drive for the price I paid. Spend an hour with Apple Care to get it working-had to use ethernet cord to my iMac OS 10.8.5 processor 2.5 GHz Intel Core i5. I did not "need" the airport as we have a Winstream SAGEMCOM modem/router (Sagemfast 1704) But, I was desperate and about to lose my old external hard drive with literally had 3 computers worth of information on it. It had already "died" once, but got it back, so once I got the airport/capsule and was told I just paid for an expensive HD, I had no time to take it back to get something else-I had to transfer my info right then. We (Apple Care) could not get it to work as a HD wirelessly. It may be because it was being set up for the first time; I don't know. I was hoping I would get a transcript of all done so I could do it myself if needed later on, but when I looked at my email-they didn't do that. (Don't know if that is normal, I was used to other "techs" sending the email.) So now I really want to try to move my airport and "extend" our wifi as it said on the "box" that you could do...
    Our Windstream router had to be placed in the lower level at the bottom of our stairs. The stairway is "open" (no door going down the steps). I want to place the Extreme at the top of the stairs so that we can use some things in our offices or not have Netflix on our TV lose connectivity when we all are on our computers.
    I know I need an ethernet cord to connect directly with the modem/router to the Airport Extreme.  I don't know what I will need to do after I connect it as it was so goofy when we set it up the first time (With the app it would disappear and not show up..) But my biggest concern is will I be able to still use the capsule as my hard drive and will I be able to do it wirelessly? (Even with it connected by ethernet, every day I have to re-connect to it before I can click on anything on the hard drive. It never shows up on it's own as my old HD did. That drives me nuts.) I do back up using the Time Capsule feature as well. I appreciate any help.

    I am still willing to plug in the ethernet cord to the modem/router and try it IF I was able to get a step by step instructions..
    Connecting the Time Capsule (TC) to the existing Winstream by Ethernet would be the basis for a roaming type network. This type of network allows you to basically "roam" with a wireless client and connect to either router. This, in essence, would provide you with an "extended" wireless network. The Apple routers can work with just about any manufacturers' routers in this fashion.
    The keys to having a successful roaming network are as follows:
    The routers must be interconnected by Ethernet.
    Both routers will broadcast their own Wi-Fi network, but MUST use the same Network Name (or SSID), wireless security type (WPA or WPA2), and wireless password.
    The TC MUST be reconfigured as a bridge.
    Connect a single Ethernet cable between one of the Winstream's LAN ports and the WAN (circle of dots) port on the TC.
    The basic steps are:
    Power-down the Winstream.
    Perform a "factory default" reset on the TC. Leave the TC powered-down after the reset has completed.
    Connect the TC to the Winstream using an Ethernet cable.
    Power-up the Winstream. Wait at least 10-15 minutes to allow it to initialize.
    Power-up the TC. Wait at least 5 minutes to allow it to initialize. (Note: Since we just reset the TC it will be performing as a wireless router that will be broadcasting an unsecured Wi-Fi network with a Network Name of something like: Apple Network NNNNNN)
    Connect your computer to the Winstream's Wi-Fi network.
    Run the AirPort Utility. select the TC, and then, select Edit.
    Go to the Network tab.
    Change the Router Mode option to: Off (Bridge Mode)
    Select the Wireless tab.
    Verify that the Network Mode option is set to: Create a wireless network
    For Wireless Network Name, enter the Wi-Fi network name used by the Winstream.
    For Wireless Security, select the equivalent security type that is used by the Winstream. (Note: Use "WPA/WPA2 Personal" if the Winstream is using WPA/TKIP. Use "WPA2 Personal" is the Winstream is using WPA2/AES.
    For Wireless Password, enter the same password used by the Winstream.
    Select Update and allow the TC to restart.
    As far as your external HD, yes you should still be able to use it as before.

  • Internal class implementing interface extending abstract interface :P

    Confused ha? Yeah me too. RIght here it goes.
    Theres an abstract interface (abstractIFace) that has for example method1() method2() and method3(). There are two other interfaces iFace1 and iFace2 that extend abstractIFace. Still with me? :P iFace1 only uses method2() whereas iFace2 uses method1(), method2() and method3(). Internal classes implementing these are then used. The reason is so that when returning an object one method can be used that will return different types of objects. But this doesnt work. It says that all the classes in the abstractIFace must be used/implemented but I only want method2() in iFace1 and all in iFace2.
    Just say what the f*ck if this is too confusing cos i think it is and i did a crap job explaining!! :P

    public interface IFace {
        void method1();
        void method2();
        void method3();
    public class Test {
        private static class Class1 implements IFace {
            public void method1() {
                System.out.println("method1");
            public void method2() {
                System.out.println("method2");
            public void method3() {
                System.out.println("method3");
        private static class Class2 implements IFace {
            public void method1() {
                throw new UnsupportedOperationException();
            public void method2() {
                System.out.println("method2");
            public void method3() {
                throw new UnsupportedOperationException();
        public static IFace createObject(boolean flag) {
            return flag ? (IFace) new Class1() : new Class2();
    }

  • Using an Apple Extended Keyboard II

    Can I use an Apple Extended Keyboard ll (MO312), which was made in the 1990s, with an iMac, OS 10.9.3? I see ADB to USB adapters for sale, but I understand that these adapters will not work with OS X. Is that true?

    Hi Ali, the discs are retail. The hdd is a transplant from a G3 B&W 300 mhz , that had OS X 10.4.5 installed. When I started the first time all was well, Software Updater found the 10.4.6 update and thats where my trouble started. The updater asked to update and then quit unexpectantly. I tried getting on line using Safari & Ie5.2 and would get the same statement " Quit unexpectantly". I had just installed the software so I had nothing to loose and decided to reinstall. And thats where I lost it all.
    Now a new glitch. while I'm writing this on my iMac, I'm still trying to install on my B&W, the blue progress bar has gone all the way across " Running Installer Script. Time remaining: less than a minute. " The colored pinwheel spun for a while but has not done anything for @ 20 mins. but i can still move the cursor on the desktop.
    Thanks

  • Ok, easy question...About implements and extends

    Im sure this will be simple to all of you, but I am still new to the Java language. I want to know the difference between using "extends" and "implements" in the way that its used in these examples:
    With the "extends" keyword...
    class PrimeThread extends Thread {
             long minPrime;
             PrimeThread(long minPrime) {
                 this.minPrime = minPrime;
             public void run() {
                 // compute primes larger than minPrime
         }And then with the "implements" keyword...
    Using the interface "Runnable"
    class PrimeRun implements Runnable {
             long minPrime;
             PrimeRun(long minPrime) {
                 this.minPrime = minPrime;
             public void run() {
                 // compute primes larger than minPrime
         }Can someone please explain when you would want to use the "extends" version and when you would want to use the "implements" version? Sorry for practically insulting your intelligence...I'm just trying to learn this language without a book as an experiment to see (how much/how fast) I can learn purely using the web resources...Thanks to anyone who wishes to explain this to me.

    That's pretty much it.
    An interface may extend zero or more other interfaces.
    A class (except Object) always extends exactly one other class--either the class explicitly named with "extends", or Object if "extends" is not present.
    A class may implement zero or more interfaces.
    "Extends" implies a parent-child relationship. Interfaces extend other interfaces, and classes extend other classes.
    "Implements" implies a contract stating that the class will provide implementations for all the methods declared in the interface (or the class will be declared abstract). If a class implements A, and A extends B, then that class must implement all methods declared in A and all methods declared in B.
    Does this help?

  • Implementing and Extends

    What is the difference between implements and extends?
    For example, public class Banner extends Applet implements Runnable =>
    If you extend a Class, then you can use the members of the superclass(which is Applet in this situation). And if you implement a Class then you can also use the members of the class. And as far as i know the Class youre implementing is called an interface. I know that an interface is not implemented yet, and it contains a lot of empty methods like public interface Series{ int getNext();  void reset();  void setStart(int x); }   .
    Then if you want to implement this interface you must use another class. In this class you define the methods and also write a couple of variables, whom you will be putting in the not implemented methods, like this=>
    class ByTwos(extends superclass) implements Series {  int start;    int val;   ByTwos(){start=0; val=0;}
    public in getNext(){val +- 2}    public void reset(){start=0; val=0;}  
    public void setStart(int x) {start=x; val=x;}        }.
    Then you create another Class with a main method and an object of type ByTwos, wherein you USE THE MEMBERS OF THE INTERFACE CLASS.
    Are the things i wrote right? What is the difference then?

    Shelby wrote:
    jverd wrote:
    If all the methods defining a type are abstract, you can make the type an interface. An
    interface is very much like a class with all abstract methods. Users of that interface
    don't care which implmentation they get. All they need to know is that they'll be able to
    call the declared methods.Dense people really annoy me, and right now I'm being REALLY dense about the advantage of using
    an interface. I can understand what you say about using an interface to define a type of something
    like an animal. But since all of the variables in an interface are final, and all of the methods are only
    signatures, it seems to me it would just be easier to create classes that use their own methods that
    actually perform a task.You're only thinking of writing the concrete classes. Think about the code that uses the type.
    Animal animal = goGetSomeRandomAnimalFromSomewhere();
    animal.speak();
    animal.feed();I define the Animal type, as an interface, and every user of Animal knows that any Animal (meaning an instance of any class that implements Animal) will be able to speak(), feed(), etc.
    Now I'm making some kind of game with animals wandering around in it. I want to draw some random animal on the screen, have it make its noise and then go eat. At the point where my code is doing that (above), I don't know what specific Animal implementation I'll get, only that it will be an Animal. So I have to declare the animal variable as a supertype of all the classes that could come back.
    The Animal type serves that purpose. It could be an abstract class, rather than an interface, but an abstract class can carry implementation, and my Animal class has no implementation. How does an Animal speak()? How does it feed()? Animal is simply a pure type. Interfaces are better suited for pure type defintions than abstract classes. That's their purpose.
    In addition, my implementing classes can implement other interfaces besides Animal, such as, for instance, Serializable or Comparable. Java doesn't support multiple inheritance of implementation, but it does support multiple inheritance of type--via being able to implement multiple interfaces.
    Remember--inheritance is primarily about type, NOT about code sharing.
    As another example, consider the java.util.List interface. You can add() to a list, remove() from it, see if it contains() a particular element, etc. There are multiple ways you could implement a List, and there's not really any common implementation you'd want to assume. So we define a List interface--the pure type--and then we implement it in very different ways via ArrayList and LinkedList. (Actually, there's a layer or two of abstract classes between List and those implementations. The abstract classes define implementations of some of the methods that do have reasonable defaults--for instance if they only rely on other methods in the List interface.)
    Now I want to do something with a List--say shuffle it or sort it or display its contents in a GUI--I don't care what kind of List you give me. I'm just going to use the methods that all lists provide to perform my operation.
    public void sort(List list) {
      // I can sort ANY List here
    }Now, if you still don't think this makes sense, can you tell me how you'd do this without interfaces?

  • Time Capsule with HH3 but want to still use HH3 Wi...

    Hi folks,
    I'm thinking about getting an Apple Airport Time Capsule (2013 version) but need to check compatability with my HH3 first.
    I've seen other posts here regarding TC and HH3 but not specifically for the configuration I want.
    I only want to use the TC for backup and do NOT want to use it as a Wifi router.
    I want to continue to use my HH3 for my Wifi network (mostly because I dont want to reconfigure all (10) of my computers with a new Wifi password).
    I'm thinking the best way to set this up would be to switch OFF the wifi on the TC and connect it directly to the HH3 using an ethernet cable. In that setup would computers connected to the HH3 via Wifi then be able to see the TC?
    Or is there a better configuration?

    Hi.
    I have a Time Capsule and have it configured in a similar fashion with my HH4. I still use Airport Utility 5.6 and in the Internet section if you set the Internet Connection Sharing to "Off (Bridge Mode)" it will disable DHCP and any device you connect to it will get its IP address from the HH. It will be visible to any other device on the network. As you say by switching off Wireless Mode you can continue using your HH for this, although the wireless capabilities of the time capsule can come in handy. I have used it to set up a "guest" network and I have also used it in WDS mode to use an Airport Express to extend my network to a non wireless device (PVR) rather than using homeplugs.
    Hope this helps.
    Andy.

  • HT201343 can you mirror say desktop 2 and still use your mac on desktop 1 with the movie playing on the tv?

    I'm interested in Apple TV for the mirroring feature through AirPlay, but will only purchase if I can still use my mac as normal whilst i'm watching what is being mirrored on the tv. Is this possible in any way? like possibly having the movie playing on desktop 2 and mirroring that and still use the mac with the other desktops to browse the internet etc?

    No, AirParrot isn't a solution for dexta,
    AirParrot gives mirroring function to older computer that are unsupported by the Apple's mirrorring function.  Dexta is looking to extend is display which isn't a feature of AirParrot.
    AppleTV will only gives you direct access to some web content using the builtin features like YouTube, Netflix, etc.  If you are looking for unsupported access to other website without using mirroring, then the AppleTV isn't the best hardware to answer your need.

  • Can extends keyword be used with respect to interfaces?

    can extends keyword be used with respect to interfaces?

    srinu269 wrote:
    can extends keyword be used with respect to interfaces?Yes. An interface can extend another interface:
    interface A {
        public void a();
    interface B extends A {
        public void b();
    class X implements B {
        public void b() {    
        public void a() {
    }

  • Using TC to extend network range.

    My home network is currently set up with 2x b/g AX's in a WDS configuration. I also have a TC (b/g and n capable) for backups. I am wondering if I can add the TC into the wireless network (rather than just joining it) to increase my range. I am thinking of using the TC as the main and the two AX as remotes to extend the network. Will this slow down my TC backups? Also would this now allow me to use TC backup from a larger range (obviously I imagine if im out of the n 5.0ghz range and its connecting to the TC via the AX this would decrease the speed, but the extra backup range would be very useful)?

    I guess I did not make myself clear when I said that everything would drop down to "g" wireless if you choose WDS. If you configure the TC to "participate in a WDS arrangement", everything...both bands on your TC....automatically drop down to 2.4 GHz "g" wireless, so the maximum speed you will attain will be "g" levels on your "n" Time Capsule.
    WDS is a "g" technology. it cannot operate at "n" level speeds.
    But, with the other 2 AirPort Express devices on the WDS network, the first will drop the bandwidth in half on the entire network and the second will drop that in half again on the entire network.
    Your entire WDS network will be operating at maximum "g" wireless with only one quarter of the original bandwidth on the network. The maximum speed that you will able to attain on the network will be approximately 13 Mbps.
    Since "n" wireless at 2.4 GHz can attain speeds of up to 130 Mbps and up to 300 Mbps at 5 GHz, your WDS network will be operating at only a small fraction of it's capability.
    If you want to use wireless only to "extend", (I suggested using ethernet with your two "g" AirPort Express devices) and you replaced the two "g" AirPort Express devices you have now with two new "n" versions, you could use Apple's "Extend a wireless network" feature and extend using wireless only.
    The "Extend a wireless network" setup will maintain "n" speeds throughout the network with a much smaller bandwidth loss (about 10-15% per device), so your network would still be working at 60-70% of it's capability. Unfortunately, you cannot use your "g" AirPort Express devices for this purpose.

  • Implements and Extends?

    I had a question about interfaces. I know how they work but I dont see the point in having them...?
    If I put methods into an Interface, then each method in the interface must appear in that class.
    abstract interface Drive {
    public void start();
    public void accel();
    public void decel();
    public void dropTop();
    public class Car implements Drive {
    }and if I have a class that extends Car, then it also implements Drive. but I dont see the benefit of having Drive at all.
    help?

    interfaces are useful when it comes to multiple inheritance, since you can't extends more than one class, but you can implement as much interface as you want
    imagine for example that your "Car" class is supposed to extends "Vehicle", but it also has to be an Observer (for the Observable/Observer pattern)
    you can make it both a Vehicle and an Observer using:
    class Car extends Vehicle implements Observer {}and if you want your car to be a vehicle, an observer, and an oil consumer:
    class Car extends Vehicle implements Observer, OilConsumer {}if you only had two classes OilConsumer and Vehicle, you would have to choose which one car will extend ; with interfaces, you can use both at one time
    interfaces can also be used as simple markers
    did you try to search a bit before asking your question here?

  • Can i unplug time capsule from the ethernet cable and still use it??

    can i unplug time capsule from the ethernet cable and still use it??

    I have tried to extend that wireless line but as soon as i remove the LAN cable i have no internet connection anymore. So basically, does the TC get the signal wireless from the router??
    The Time Capsule can wirelessly extend a wireless signal....but only if it is being provided by another Apple AirPort wireless router.
    If the "main" rotuer there is not an Apple AirPort router,  you will need to connect to the network using a wired Ethernet connection.

  • Using an Apple Extended Keyboard ll with iMac, OS 10.9.3.

    Can I use an Apple Extended Keyboard ll (MO312), which was made in the 1990s, with an iMac, OS 10.9.3? I see ADB to USB adapters for sale, but I understand that these adapters will not work with OS X. Is that true?

    Can I use an Apple Extended Keyboard ll (MO312), which was made in the 1990s, with an iMac, OS 10.9.3? I see ADB to USB adapters for sale, but I understand that these adapters will not work with OS X. Is that true?

  • Implements versus Extends

    I'm an inexperienced programmer.
    After reading a number of articles I've been convinced that its generally better to use interfaces and implements, as opposed to classes and extended subclasses. However, I'm not sure how I should do that given my current situation?
    I have a base class with a number of functions and variables. There is one function that I need to implement differently for a number of situations. At the moment I have something like...
    class base {
    int a;
    int b;
    void functionA() { does whatever; }
    void functionB() { does whatever; }
    class baseA extends base {
    void functionC() { does whatever; }
    class baseB extends base {
    void functionC() { does whatever; }
    class baseZ extends base {
    void functionC() { does whatever; }
    If I use implements instead of extends, doesn't that mean I have to include a copy of functionA and functionB in all of those subclasses? Isn't that inconvenient? Or is there a better way of doing this?
    Thanks for any help!

    I'm an inexperienced programmer.
    After reading a number of articles I've been convinced
    that its generally better to use interfaces and
    implements, as opposed to classes and extended
    subclasses. However, I'm not sure how I should do
    that given my current situation?
    I have a base class with a number of functions and
    variables. There is one function that I need to
    implement differently for a number of situations. At
    the moment I have something like...
    class base {
    int a;
    int b;
    void functionA() { does whatever; }
    void functionB() { does whatever; }
    class baseA extends base {
    void functionC() { does whatever; }
    class baseB extends base {
    void functionC() { does whatever; }
    class baseZ extends base {
    void functionC() { does whatever; }
    If I use implements instead of extends, doesn't that
    mean I have to include a copy of functionA and
    functionB in all of those subclasses? Isn't that
    inconvenient? Or is there a better way of doing this?
    Thanks for any help!Intefaces aren't always the better choice, and I would say that the situation you descibe is one of those cases where they aren't the better choice.

Maybe you are looking for