Implementing generic and regular version of same interface

I wanted to create a class that extends AbstractMap<Integer,Integer> and implements org.apache.commons.collections.BidiMap. BidiMap extends java.util.Map (not generic). I've gotten completely confused on how Java handles classes that implement multiple versions of an interface. Seems like you're not allowed to do it unless you introduce a layer of indirection. Even this is not really consistent
public class A {
  public interface B<T> {public T a();}
  public interface C extends B {}
  public class D implements B<Integer> {public Integer a() {return 0;}}
  // Illegal
  public class E implements B<Integer>, C {public Integer a() {return 0;}}
  // why is this allowed?
  public class F extends D implements C {public Integer a() {return 0;}}
  public interface G<T> {public void a(T pArg);}
  public interface H extends G {public Object b();}
  public class I implements G<Integer> {public void a(Integer pInt) {}}
  // Illegal.  Huh?
  public class J extends I implements G {public Integer a() {return 0;}}
}Anyone care to enlighten me on how this works? Is there any way to accomplish the original goal (extending AbstractMap<Integer,Integer> and implementing BidiMap)?

I've gotten completely confused on how Java handles classes
that implement multiple versions of an interface.It doesn't handle classes that implement multiple versions of an interface.
why is this allowed?On my machine, it isn't.A.java:9: A.B cannot be inherited with different arguments: <> and <java.lang.Integer>
  public class F extends D implements C {public Integer a() {return 0;}}

Similar Messages

  • TV and ipod version of same show - itunes is confused

    I have an EyeTV and I record many HD PBS shows off air. I export the shows twice, once to TV as a 960x540 H.264 file and once to the ipod as a 640x360 H.264 file. I end up with two shows with the same name and the library view in iTunes makes no distinction between TV shows created using different video dimensions. They all get lumped together into TV Shows. In album view there is no way to tell which version is which unless you change the name of the show to reflect its size. This seems silly.
    Is there any way to get the iTunes library to keep TV and iPod videos separate?

    I've gotten completely confused on how Java handles classes
    that implement multiple versions of an interface.It doesn't handle classes that implement multiple versions of an interface.
    why is this allowed?On my machine, it isn't.A.java:9: A.B cannot be inherited with different arguments: <> and <java.lang.Integer>
      public class F extends D implements C {public Integer a() {return 0;}}

  • Is it possible to have PDF and PNG versions of 'same' folio

    Is it possible when copying over the articles to have one folio as PDF and another as PNG?
    Tried doing this by setting up an alternative folio as PNG and copying across the articles that were created for the original PDF folio, but they still appear to be PDF when loaded into the new folio and previewed on tablet, even though it has been set to PNG.
    Do they only get converted to PNG when published? shouldn't one be seeing thumbnails in the DPS Folio Producer: Editor browser window. Trying to preserve the meta data tags between folios, or do I have to re-export these files and re-input the tags and attributes manually.
    I see there is a way of copying articles between folios at an admin level, would this result in a correct transposition of PDF to PNG?

    We use the K4 publishing system, and haven't started using their plugin yet, as we are still 'kicking the tires'. That said PDF and Android don't play together so well, hence looking at a PNG version without having to re-enter all the metadata again, which is what happens with the method you describe above.
    The trouble is that the meta data is not part of the Indesign document so we have to re-enter it all plus there is the open/checkout/checkin/close of all documents from K4 which is a royal PIA, so uploading the same indesign documents isn't really helping. If the sidecar file worked 'properly' then perhaps that might be a solution, hear its not quite there though?
    So, copying the article across to a new folio looked like it might work but not sure why when it asks when setting up the folio, whether you want PDF or PNG specs those do not stay set or why they are ignored on copying to the new supposed PNG rendition.
    Would the K4 plugin solve this? would it work for all formats if we are building an Ipad and iPhone and Android version of a folio from the same document sourced in K4.

  • G/L A/C Determination for Drop Ship and Regular Ship of Same Item

    Hello Friends,
    We have a scenario,
    Stock is Sales order valuated stock
    For the same material, some times we do a drop shipment from vendor and some times we do a regular shipment from our plant.
    Being sales order valuated stock the GL account (On the PR generated from sales order) for drop shipment is getting picked up from BSX. (standard SAP)
    Our Finance team dont want the G/L account from BSX to be picked up.
    Because the BSX G/L account is a finish good G/L account and we dont want to use that for drop ship.
    How do we solve this issue?
    What is the standard process to get the G/L account if the same material is drop shipped and regular shipped?
    Thanks for your help.
    Thil

    Hi,
    The most common way to solve your problem is to use split valuation.
    This can be easily done. I you want to know how to use split valuation let me know I will detail steps you need to follow.
    Regards
    Srinivas

  • Have BOTH .m4a and .m4p versions of same purchased songs after re-import

    Hello,
    I recently had to reconstruct my iTunes library (new machine, new installation) and so I did an "Add to Library" of my library folder into an empty iTunes library. After import, I've discovered that for about 215 songs which I've purchased from the iTunes Store, I have both .m4a and .m4p versions of each of these songs. If I view the "Kind" of each song within iTunes, the .m4a shows a "Kind" of "Purchased AAC Audio File", and the .m4p version shows a "Kind" of "Protected AAC Audio File". If I show the Bitrate, each copy of each song is the same, 256 Kbps. If I view each song file in the Finder, the .m4a is about double the size of the .m4p. I have a few questions surrounding this:
    1. Why are the sizes of the song files so drastically different?
    2. Some time ago I took advantage of that DRM-free promotion, so I am suspecting that this may have had something to do with me having both protected and non-protected copies of these files. However, I am curious why both files now show in my library, whereas before, they did not -- only one copy showed. Does anyone know why both song copies are now showing?
    3. Should I keep both of these files?
    4. Is there a way to manage these files in iTunes so that only one copy shows? They both show when duplicates are hidden, because they are different, or iTunes doesn't know of the association I suppose. But of course that messes up trying to play an album -- every song plays twice.
    Thanks in advance for your answers.
    Brad

    No--nothing gets deleted when you convert. You get two copies of the song in your library. (On Edit: I haven't done this with the latest version of iTunes. I assume nothing gets deleted just like before. To check--maybe you should convert ONE song and see if you get a duplicate in a smaller version, or just a smaller version! I've always gotten duplicates!)
    I did leave out a few steps on how I do this--but if you're interested here's how I do it. Make the playlist. Then go to Edit>Select All. Then I go back to the top line: Advanced>Convert Selection to AAC. (To be able to do this you have to have your import option set to AAC 128 kps under the advanced tab in your Preferences settings. After you do the conversion make sure you set this tab back to your preferred lossless import option!)
    You will get two copies of the songs in your library. Your original playlist will contain the lossless songs, so you'll have to pull the AAC songs back out into a play list. You can find them easily by sorting your library by "Kind" and then pulling the AAC files into a playlist. You can label this iPhone--or whatever.
    After you load the playlist onto your iPhone, uncheck it so the songs are not duplicated in your library. If you ever want to delete them, you have to do this inside your library or the file will remain on your computer. (It does take a while to run the conversion--so I rarely delete things afterwards if I think I'm going to use the file again.)
    Post back if you still have other questions.

  • Use different DPS accounts for iPad and Android versions of same app?

    Hi there,
      When creating an Android version of an iPad DPS app should the account used to create the content (the 'Title ID' in the DPS App Builder) be the same for both versions, or different? In the content viewer I know that iPad content will show up even on Android, so I'm thinking that the answer is probably no, but I haven't managed to find it mentioned in the Adobe docs.
      Thanks,
    Toby

    It depends, but usually the answer is that you want to use a different account for iOS and Android. Not all features supported in the iOS viewer are supported in the Android viewer. For example, if you use panoramas or iOS-specific web views in your articles, you'll want to be able to use different content for the Android viewers. Search for "dps supported features" for a comparison chart.
    I use different Application accounts for my apps. I use the Share/Copy feature to transfer the folios from the iOS account to the Android (or Windows) account. Then I delete the few articles that don't work well in the viewer and replace them with articles generated from different source files. That works well and doesn't require too much extra effort.
    If you want to reduce the amount of letterboxing in Android viewers, you'll definitely want to use different accounts and use, for example, 1280x800 folios instead of 1024x768.

  • Recording both PAL and NTSC versions of same project

    I am importing a series of movies to iMovie in PAL format. I understand that it automatically sets the format. What steps should I follow to ensure that I can have both versions of the same footage correctly (PAL and NTSC)? On my first attempt to record on iDVD I had not changed the setting to PAL (even though iMovie project is PAL). A warning message showed that there were conflicting formats but I recorded the DVD and now it works on my NTSC TV and DVD. Then I changed the iDVD setting to PAL and made another copy. When I check the DVD's under Window>Movie Info (Quicktime) they seem to be in the correct format. It happened by accident but I understand that you should export your movie from iMovie in the new converted format in order to record a DVD in such format. I accidentally bypassed that step and I wonder if the quality has been lowered. Has anyone experienced this also? Should I do the same to save me an extra step? Thanks for feedback on this.
    PowerBook G4   Mac OS X (10.4.9)  

    The conversion from PAL to NTSC (or NTSC to PAL) is a non-trival task.
    In the case of PAL to NTSC, not only must the frame size be changed from 720x576 pixels to 720x480 pixels (fairly easy resizing), but the frame rate must be changed from 25 frames/second to 29.97 frames/sec (this frame rate change is NOT easy). iDVD/QuickTime seem to simply duplicate an occasional frame to go from 25 to 29.97 fps (or delete an occasional frame going from 29.97 to 25 fps) - this technique can cause the converted movie to be rather jerky.
    You will probably get a better conversion use JES Deinterlacer at http://www.xs4all.nl/~jeschot/home.html as mentioned by Bengt

  • Can a class be generic and Cloanebale at the same time

    The code below exemplifies my question. Basically I have MyClass which should be a generic Class and also Cloneable. However, how can I copy the field "T a;" within the clone() method without being specific?
    Type safety does not bother me in my case, it would be enough to keep MyClass generic.
    Does anyone has any hints?
    Carlos
    public class MyClass<T> implements Cloneable {
        T a;
        public MyClass(T a) {
            super();
            this.a = a;
            System.out.println(a);
        public MyClass clone() {
            MyClass o = null;
            try {
                o = (MyClass)super.clone();
            catch(Exception e) {
                e.printStackTrace();
            // This line is where I cannot be generic -> Sux!
            o.a = new String(a + "");
            return o;
        public static void main(String[] args) {
            MyClass<String> foo = new MyClass<String>("zero");
            MyClass<String> fooClone = foo.clone();
    }

    I guess you could use reflection and do something like the following:
    import java.lang.reflect.Constructor ;
    import java.lang.reflect.Method ;
    public class MyClass<T> implements Cloneable {
      T a ;
      public MyClass ( final T a ) {
        // super ( ) ; // Superfluous
        this.a = a ;
      public MyClass<T> clone ( ) {
        MyClass<T> o = null ;
        try { o = (MyClass<T>) super.clone ( ) ; }
        catch ( Exception e ) { e.printStackTrace ( ) ; System.exit ( 1 ) ; }
        o.a = null ;
        //  See if there is an accessible clone method and if there is use it.
        Class<T> c = (Class<T>) a.getClass ( ) ;
        Method m = null ;
        try {
          m = c.getMethod ( "clone" ) ;
          o.a = (T) m.invoke ( a ) ;
        } catch ( NoSuchMethodException nsme ) {
          System.err.println ( "NoSuchMethodException on clone." ) ;
          //  See if there is a copy constructor an if so use it.
          Constructor<T> constructor = null ;
          try {
            System.err.println ( c.getName ( ) ) ;
            constructor = c.getConstructor ( c ) ;
            o.a = constructor.newInstance ( a ) ;
          } catch ( Exception e ) { e.printStackTrace ( ) ; System.exit ( 1 ) ; }
        } catch ( Exception e ) { e.printStackTrace ( ) ; System.exit ( 1 ) ; }
        return o ;
      public String toString ( ) { return "[ " + ( ( a == null ) ? "" : a.toString ( ) ) + " ]" ; }
      public static void main ( final String[] args ) {
        MyClass<String> foo = new MyClass<String> ( "zero" ) ;
        MyClass<String> fooClone = foo.clone ( ) ;
        System.out.println ( "foo = " + foo ) ;
        System.out.println ( "fooClone = " + fooClone ) ;
    }

  • HiDef and Regular DV in Same iMovie

    Help - after one month of working on an iMovie project where I've got the first 3 minutes shot with an HD camera and the rest with a regular DV camera I'm getting some comments that I won't be able to export to iDVD. Is that right? It's a really big project so I haven't yet tried (and I just found out today). I've been told that I should use Final Cut Express but I'm not sure what's involved to replicate my project in FCE.
    Can someone who knows confirm whether or not I can convert my iMovie to DVD?
    Thanks!!!!

    Welcome to iMovie Discussions.
    Yes, you can combine the two. (..The hi-def gets knocked down to standard-def anyway when passing the project to iDVD to burn..)
    Here's an unprepossessing clip - meaningless to look at! - but the first part (with music) was shot in 16:9 hi-def, and the second (wildly waving round my workroom) is standard-def 4:3. They both combined easily into a 16:9 (supposedly HD) project, and both played together perfectly happily.
    On export to iDVD (..or to this gallery page..) they're both standardised as standard-def.
    It's just a quick'n'nasty throw-together to show that it works, here.

  • IPhoto '11 v. 9.2.3 bug when splitting events containing flagged and duplicate versions of same photo in Event.

    UPDATE:
    Okay, I don't know how to delete this - so I'm just saying that after sending this, I found Terrance's reply to a similar post (3/3/12).  I didn't realize iPhoto had been changed so that the "master" controls duplicates.  I do understand how to export, et cetera .... and I do use albums also!  I just really want the duplicate photos to NOT be in the general Events.  Trust me, I have a good reason!
    Thank you for your (previous) help!
    ~h
    Okay, when I created this User Name, I didn't foresee this situation.  I'm pretty sure this is a real bug - and maybe someone can let the appropriate programmer know....
    Essentially, I'm organizing my 2012 iPhoto library and am trying to get around the rule that a photo can only be in one Event.  I flagged the photos I want to keep where they are - AND - be grouped separately.
    Then in Flagged, I duplicated all.  Then I unflag the orginal files.
    Then I modified the duplicated (version 2 or version 3) files.
    So, in the original events, there are the two versions of some photos.
    Opening one of the events, I select a couple of photos and "split".
    Split event does get created, but it has no photos.
    Photos and duplicated photos remain in original event.
    I'm quitting now - before I lose everything.....!
    (I'll back up the library and try again later.........!)
    and jsut for the fn of it, I'm adding that I find it strange that I'd have to manually click "abc-check" -- that spellcheck doesn't run automatically.   --I guess it annoys others?
    holly

    First Try the following:
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your
         User/Home/Library/ Preferences folder.
    2 - delete iPhoto's cache file, Cache.db, that is located in your
    User/Home/Library/Caches/com.apple.iPhoto folder (Snow Leopard and Earlier).
    or with Lion and Mt. Lion from the User/Library/Containers/com.apple.iPhoto/
    Data/Library/Caches/com.apple.iPhoto folder
    3 - launch iPhoto and try again.
    NOTE:  In Lion and Mountain Lion the Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.
    If that doesn't help apply the two fixes below in order as needed:
    Fix #1
    1 - launch iPhoto with the Command+Option keys held down and rebuild the library.
    2 - run Option #4 to rebuild the database.
    Fix #2
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    1 - download iPhoto Library Manager and launch.
    2 - click on the Add Library button and select the library you want to add in the selection window..
    3 - Now that the library is listed in the left hand pane of iPLM, click on your library and go to the Library ➙ Rebuild Library menu option.
    4 - In the next  window name the new library and select the location you want it to be placed.
    5 - Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments.  However, books, calendars, cards and slideshows will be lost. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.

  • CSS11503 - Inbound and outbound traffic on same virtual interface

    Setup two CSS11503's running 8.10. Running and active/passive config.
    Two groups of servers each with a VIP. Both groups of servers on the same VLAN.
    The VIP's reside on VLAN1 and the servers are on VLAN2
    Problem:
    Servers from one group cannot access the other via it's VIP. Servers cannot access themselves via their VIP as well.
    Can ping the vip's with out a problem.
    I assume that this is because that traffic generated by a client is going in and out of the same interface.
    I have come across similar problems on various firewalls.
    Is there anyway of getting around this.
    Thanks
    Julian

    Julian,
    this is not the same issue as firewall preventing traffic to go in and out the same interface.
    The problem here is that the CSS will receive traffic from Server1, it will nat the vip into Server2 and forward traffic keeping the src ip unchanged.
    So, when Server2 replies, it sends the response to Server1. Since they are on the same subnet, the response bypass the CSS and Server1 receives a response from Server2 which is unknown to Server1 since it expects a response from the Vip.
    The solution is to implement source nat on the CSS for traffic originating from the servers.
    This can be done with a group and an ACL.
    This was discussed many times, so I think you should be able to find a sample config somewhere.
    If you can't let me know.
    Gilles.

  • Installing 'debug' and regular flash players on same machine

    Has anyone successfully installed the DEBUG and regular
    versions of Flash Player 9.0.115 on the same machine? I'm having
    trouble finding instructions on how to do this. I want to use the
    DEBUG version for development and the regular version for speed
    testing...
    Thanks
    J

    Hi,
    It is possible..but the installation procedure is not that easy. I've described this procedure on http://www.chow1.myweb.nl (about 1,5 years ago).
    It works fine..but it is history for me..So, at your own risk...no further support.
    HTH
    Martin
    null

  • AP and AR in same interface?

    Hi,
    We are planning to do the AP and AR of a legacy system in SAP through interface.  If both AP and AR are done from a common inventory, can we do both the AP and  AR in the same interface? Or can it be done in two different interfaces? What is the difference between doing both in the same interface and two different interface?
    Please give me some info on it. I'm new to FI..
    Thanks..
    Uma.

    I can't think of any. If you separate them, you can run them in parallel, so that should be quicker too.
    But in the end, I think it's a business decision.
    Rob

  • Drag and drop row within same table.

    Version 12.1.2
    I am trying to implement drag and drop row within same table, and I am trying to follow this sample from Frank:
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/106-reorder-table-rows-1921121.pdf
    But, I am getting this cast exception. The code I have in my dropEvent bean is identical to whats on the sample.
    oracle.jbo.server.ViewRowImpl cannot be cast to oracle.jbo.uicli.binding.JUCtrlHierNodeBinding
    ADF_FACES-60097:For more information, please see the server's error log for an entry beginning with: ADF_FACES-60096:Server Exception during PPR, #1
    Not sure if anything has changed on 12c release, or if I am missing anything.
    Here is my complete code:
    public DnDAction doDnD(DropEvent dropEvent) {
    RichTable table = (RichTable) dropEvent.getDragComponent();
    List dropRowKey = (List) dropEvent.getDropSite();
    if (dropRowKey == null) {
    return DnDAction.NONE;
    Transferable t = dropEvent.getTransferable();
    DataFlavor<RowKeySet> df = DataFlavor.getDataFlavor(RowKeySet.class, "rowmove");
    RowKeySet rks = t.getData(df);
    Iterator iter = rks.iterator();
    List draggedRowKey = (List) iter.next();
    JUCtrlHierNodeBinding draggeRowNode = (JUCtrlHierNodeBinding) table.getRowData(draggedRowKey);
    Row dragRow = draggeRowNode.getRow();
    JUCtrlHierNodeBinding dropRowObject = (JUCtrlHierNodeBinding) table.getRowData(dropRowKey);
    Row dropRow = dropRowObject.getRow();
    //get the table's ADF JUCtrlHierBinding
    CollectionModel collectionModel = (CollectionModel) table.getValue();
    JUCtrlHierBinding treeBinding = (JUCtrlHierBinding) collectionModel.getWrappedData();
    DCIteratorBinding objectsIterator = treeBinding.getDCIteratorBinding();
    RowSetIterator rsi = objectsIterator.getRowSetIterator();
    int indexOfDropRow = rsi.getRangeIndexOf(dropRow);
    dragRow.removeAndRetain();
    rsi.insertRowAtRangeIndex(indexOfDropRow, dragRow);
    objectsIterator.setCurrentRowIndexInRange(indexOfDropRow);
    AdfFacesContext adfctx = AdfFacesContext.getCurrentInstance();
    adfctx.addPartialTarget(table.getParent());
    return DnDAction.MOVE;
    It does not seem to like this line of code:
    JUCtrlHierNodeBinding draggeRowNode = (JUCtrlHierNodeBinding) table.getRowData(draggedRowKey);
    I would greatly appreciate any help.
    Thanks.

    Well there has bee a changes somehow. using 12c
    table.getRowData(draggedRowKey);
    returns a ViewRowImpl and no longer anything which can be convertet to JUCtrlHierNodeBinding. Anyway, the fix is easy:
        public DnDAction onDepartmentsRowDrop(DropEvent dropEvent) {
            //get the table instance. This information is later used
            //to determine the tree binding and the iterator binding
            RichTable table = (RichTable) dropEvent.getDragComponent();
            List dropRowKey = (List) dropEvent.getDropSite();
            //if no dropsite then drop area was not a data area
            if (dropRowKey == null) {
                return DnDAction.NONE;
            //The transferable is the payload that contains the dragged row's
            //row key that we use to access the dragged row handle in the ADF
            //iterator binding
            Transferable t = dropEvent.getTransferable();
            //get the row key set of the dragged row. The "rowmove" string is the
            //discriminant defined on the drag source and the collectionDrop target.
            DataFlavor<RowKeySet> df = DataFlavor.getDataFlavor(RowKeySet.class, "rowmove");
            RowKeySet rks = t.getData(df);
            Iterator iter = rks.iterator();
            //for this use case the re-order of rows is one-by-one, which means that the rowKeySet
            //should only contain a single entry. If it contains more then still we only look at a
            //singe (first) row key entry
            List draggedRowKey = (List) iter.next();
            //get access to the oracle.jbo.Row instance represneting this table row
            Object objdragg = table.getRowData(draggedRowKey);
            Row dragRow = (Row) objdragg;
            Object objdrop = table.getRowData(dropRowKey);
            Row dropRow = (Row) objdrop;
            //get the table's ADF JUCtrlHierBinding
            CollectionModel collectionModel = (CollectionModel) table.getValue();
            JUCtrlHierBinding treeBinding = (JUCtrlHierBinding) collectionModel.getWrappedData();
            //get access to the ADF iterator binding used by the table and the underlying RowSetIterator.
            //The RowSetIterator allows us to remove and re-instert the dragged row
            DCIteratorBinding departmentsIterator = treeBinding.getDCIteratorBinding();
            RowSetIterator rsi = departmentsIterator.getRowSetIterator();
            int indexOfDropRow = rsi.getRangeIndexOf(dropRow);
            //remove dragged row from collection so it can be added back
            dragRow.removeAndRetain();
            rsi.insertRowAtRangeIndex(indexOfDropRow, dragRow);
            //make row current in ADF iterator.
            departmentsIterator.setCurrentRowIndexInRange(indexOfDropRow);
            //ppr the table
            AdfFacesContext adfctx = AdfFacesContext.getCurrentInstance();
            //note that the refresh of the table didn't work when refreshing the table
            //so I needed to refresh the container component (af:panelStretchLayout).
            adfctx.addPartialTarget(table.getParent());
            return DnDAction.MOVE;
    does the trick. I changed the line to
    //get access to the oracle.jbo.Row instance represneting this table row
            Object objdragg = table.getRowData(draggedRowKey);
            Row dragRow = (Row) objdragg;
    so you don't need the detour through the JUCtrlHierNodeBinding any longer.
    Timo

  • It is true that large companies like Avid and others in the same industry have access to test versions and final versions of the OS before the regular developers?

    A friend of mine that works with Pro Tools and knows people from big studios in Hollywood told me that these studios, from big recording studios e from big companies like Avid have access to the test and final versions of the Apple's OSs before the regular developers. Is it really true?

    Apple has a rainbow of working arrangements with various 3rd parties.
    From the onsite testing labs in the Bay Area to coders/studios that have far reaching needs, there are any number of efforts going on that are well ahead of the consumer-level products seen by the masses. This is what drives what eventually arrives on computers of both garden variety devs and consumers.
    Don't expect too much detail, however, as the NDAs are very strict at that level.

Maybe you are looking for