Keyword "this"

What exactly is keyword -"this" ?
can nyone explain me "this" in regards with execution on cpu?

varunsharma wrote:
What exactly is keyword -"this" ?[First hit on google search|http://java.sun.com/docs/books/tutorial/java/javaOO/thiskey.html]
can nyone explain me "this" in regards with execution on cpu?Dude, that's like asking someone what affect using 91 octane instead of 87 has on the output of their car's subwoofer.

Similar Messages

  • The keyword "this"

    Hi,
    I was looking at a source code and I saw a very weird statement that to my knowledge contradict with some Object-Oriented Programming concepts. The statement is something like:
    Component comp = Component.this;
    what I know is that using the class name we can access static properties and methods, but the "this" keyword refers to an instance of the class. I'm trying to get sense of this statement. Can someone help? Thanks.
    Regards
    Tariq A.
    ======

    it's necessary at least in following scenario
    class a
      int component;
      class b
        int component;
        public void method()
           // instance of class a
           a.this
          // instance of class b
           this? or b.this
          // and this leads to...
           a.this.component
          // and
           b.this.component
    }Or something like that at least...

  • Keywords "this" and "super"

    Hi,
    For the readability of my codes, I use the keyword "super" instead of "this" or nothing in a class to refer to the metheod defined in its super class, even if there is no overwritting of that method.
    Is there any risk of this practice?
    Your comments are welcome.
    Cheers,
    Pengyou

    I was not convinced by the first two ...You should have your keyboard taken away. :pclass RealizationOfSomething {
    protected void doSomething() {
    // implementation here
    // implementation here
    // implementation here
    // implementation here
    // implementation here
    // implementation here
    // implementation here
    class MyClass extends RealizationOfSomething {
    public void doSomethingElse() {
    //first do many other things .....
    //then doSomething as
    super.doSomething(); // 1
    this.doSomething(); // 2
    doSomething(); // 3
    A: if MyClass overrides doSomething, then 1 is different from 2
    B: if MyClass does not override doSomething, then is 1 the same as 2 (performance)?
    If yes, then for the reason of "readability", I prefer 1; for the reason of maintenance, I accept 2.
    In any case, I would ignore the lazy case 3, although most people use it.
    This is my conclusion.
    Pengyou

  • Keyword This needs help

    i have this code......
    package Project;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    import java.awt.image.*;
    /*Scope use*/
    import java.awt.geom.*;
    import java.io.*;
    import java.net.*;
    import javax.imageio.ImageIO;
    import javax.swing.event.*;
    public class Picture extends JPanel
         /* variables */
         JLabel pic;
         private int HORIZONTAL;
         private int VERTICAL;
         /* Scope */
         Ellipse2D.Double scope;
        BufferedImage image;
        Dimension targetSize;
        double scale;
    public Picture()
             scope = new Ellipse2D.Double(0, 0, 150, 150);
             targetSize = new Dimension();
             ScopeController control = new ScopeController(this);
             addMouseListener(control);
             addMouseMotionListener(control);
              pic = new JLabel();
              add(pic);
              setVisible(true);
    class PictureThread extends Thread implements Runnable
         private int sleepTime;
         PictureThread picThread;
    public PictureThread(String name)
              super(name);
              sleepTime=(int) (5000);
    public void start()
              picThread= new PictureThread("pic" );
              picThread.start();
    public void run()
              int i=1;
              while(i<=21)
                   System.err.println(i);
                   createImage("" +i);
                   i++;
                try
                     Thread.sleep(sleepTime);
                     System.out.println("Tried to sleep1");
                catch(InterruptedException e)
                     System.out.println("Ai yo, gt interrupted");
    public Image createImage(String filename)
                   ImageIcon image=new ImageIcon("images/"+filename+".PNG");
                   return image.getImage();
    public class ImagePanel extends JPanel
              private Image image=null;
    public void showImage(Image image)
              this.image=image;               
              repaint();
    public void paintComponent(Graphics g)
              super.paintComponent(g);
              g.drawImage(image,0,0,850,256,this);
    class ScopeController extends MouseInputAdapter
        ScopeTest test;
        Point offset;
        boolean dragging;
    public ScopeController(ScopeTest st)
            test = st;
            offset = new Point();
            dragging = false;
    public void mousePressed(MouseEvent e)
            Point p = e.getPoint();
            if(test.scope.contains(p))
                offset.x = (int)(p.x - test.scope.x);
                offset.y = (int)(p.y - test.scope.y);
                dragging = true;
    public void mouseReleased(MouseEvent e)
            dragging = false;
    public void mouseDragged(MouseEvent e)
            if(dragging)
                int x = e.getX() - offset.x;
                int y = e.getY() - offset.y;
                test.setScope(x, y);
        }There is an error which i cannot solve...
    --------------------Configuration: <Default>--------------------
    C:\Documents and Settings\user.TEMASEK-P1OHXPC\My Documents\Project\Picture.java:32: cannot find symbol
    symbol : constructor ScopeController(Project.Picture)
    location: class Project.ScopeController
    ScopeController control = new ScopeController(this);
    ^
    1 error
    how do i solve tis problem??

    ScopeController control = new ScopeController(this);While creating a ScopeController object ,u are passing this object i.e.
    object of Picture class. But the ScopeController constructor requires
    ScopeTest object
    public ScopeController(ScopeTest st)If u have developed the aboev code, u might be knowing what these different classes are.

  • I use firefox 8.d older versions,by default,hd a feature tht enabled SMART KEYWORD searches.i did nt hv 2 SET KEYWORDS.4 example,typing UTUB in d address bar wd open YOUTUBE.its not happening with this version.plz help me get those settings back.

    ''duplicate = locking - https://support.mozilla.com/en-US/questions/897627''
    more examples..
    typing GOOGLE LANG in the address bar wd take me to GOOGLE LANGUAGE TOOLS.
    SGS SE in the in the address bar would take me to SGSSTUDENTBOSTADER.SE.
    even WRONGLY TYPED or truncated keywords would take me to a proper and logical URL as a result. for example, GAMIL used to take me to GMAIL.
    i did not have to set ANY KEYWORDS. this feature was there by DEFAULT. PLEASE help me restore it. it is frustrating to type the whole url.

    ''duplicate = locking - https://support.mozilla.com/en-US/questions/897627''
    more examples..
    typing GOOGLE LANG in the address bar wd take me to GOOGLE LANGUAGE TOOLS.
    SGS SE in the in the address bar would take me to SGSSTUDENTBOSTADER.SE.
    even WRONGLY TYPED or truncated keywords would take me to a proper and logical URL as a result. for example, GAMIL used to take me to GMAIL.
    i did not have to set ANY KEYWORDS. this feature was there by DEFAULT. PLEASE help me restore it. it is frustrating to type the whole url.

  • _name property for this keyword

    When you are using the keyword this inside of an event
    handler it refers to the object that triggered the event.
    For example if OnLoadInit of a sound object is triggered you
    can say
    this.play();
    Is there any way of returning the instance name of this the
    way you can get the name of a movie clip
    ie somemovieclip_mc._name
    It is probably not that simple. If there is a solution it
    probably needs several lines of code.
    However, it would be worth while for a lot of debugging
    purposes.
    Any help would be greatly appreciated.

    Thanks for the quick reply
    Here is an example of the kind of situation I am talking
    about
    this.createEmptyMovieClip("mcSoundHolder",this.getNextHighestDepth());
    //trace("root"+ this._proto_toString);
    var sndAudio:Sound =new Sound(mcSoundHolder);
    var oNameHolder:Object = new Object();
    oNameHolder=this;
    sndAudio.loadSound("scattershot_endings.mp3",false);
    sndAudio.onLoad =function(bSuccess:Boolean ):Void{
    if (bSuccess){
    this.start();
    oNameHolder=this;
    trace (this );
    trace (this );
    yields [object Object]
    I was hoping to get sndAudio
    Alfred

  • Need to set/read 'Keyword' in a PDF programatically

    We have adobe professional license ver 9.
    When a user downloads a PDF from our custom web application (C#), we need to set a keyword (attribute) to the PDF automatically. The 'Keywords' field in 'File > Properties' seems to be ideal location.
    User typically edits this downloaded PDF and uploads it again back to the web application. During this editing, the keyword is assumed to remain the same.
    Finally, user uploads the edited PDF back to the web application. At this point, the keyword is to be read from PDF.
    Kindly suggest API's to set/read keyword.

    This is not a scripting question. The solution needs to be in the custom
    application you're using to create the PDF files.
    The "Keywords" field is just a part of the document metadata, which any PDF
    library should be able to edit.
    On Fri, Dec 9, 2011 at 12:54 PM, sandhya_sky is the limit

  • IPhoto 9.4.3-keyword "" not working correctly in smart albums

    Every May I work on the 5th Grade recognition slideshow (using Keynote) for our 5th grade students.  In iPhoto, I always give photos the checkmark keyword after I've placed that photo so that I know it's been added/used.  I have many smart photo albums with keywords like "5th graders 2012-2013" and others like the checkmark. 
    None of the smart albums seem to be recognizing and using the checkmark even though it's one of the smart album criteria.  For example, I have a smart album called
    "5th grade-already used" which has the criteria Match All:  Keyword is "5th graders-2012-2013" and Keyword is "✔".  However, even after giving some photos the checkmark keyword, this smart album shows up empty.
    Similarly, I have another smart album called "5th-Still to use" which has criteria Match All: Keyword is "5th graders-2012-2013" and Keyword is not "✔". The photos that I've placed the checkmark on are STILL showing up here.
    These smart albums have always worked before.  Has anyone else noticed issues with the checkmark keyword not working properly?  It has to have happened with an update sometime in the past year.

    When I went to open the library using iPhoto Library Manager, it had to upgrade the library to work with this version of iPhoto.
    That's normal.
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In Library Manager it's the FIle -> Rebuild command)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. 
    Regards
    TD 

  • Adding/Deleting keywords for multiple images

    Well, I'm finally paying the price for bad keyword management and I'm trying to clean up my nightmare of a system now but running into trouble.
    I'm using Lightroom 3.2.
    My workflow follows one of two types:
    1) I'm shooting something specific (soccer games) and I import the shots and immediately assign the appropriate keywords (soccer, which kid it is, which tournament it is)
    2) I've taken shots of multiple events/subjects and I haven't had time to download and organize.  I will then import with a 'file later' tag so I can easily search and keyword them later and then re-use the card.
    Well 'file later' is now about 3000 images!  Doh!
    I'm going through and properly assigning them but I'm having a lot of trouble with what I *think* should work in Lightroom.
    There are several things here:
    First, if I choose the 'File Later' keyword, it will pull up the metadata filters options on the top of the grid view.  No matter what I do, I can't make it go away.  If I do get it to go away, I wind up viewing ALL my pictures which is not what I want.
    Second, if I choose multiple pictures by ctrl-clicking or shift-clicking, It appears I can assign a keyword to multiple shots.  I cannot REMOVE a keyword from multiple shots. Lightroom seems to only want to remove the keyword from one picture at a time even if they are all selected.
    Third, the painter tool does not work...at all.  Enabling it and then selecting and applying or removing does nothing.
    So, what am I looking for here? 
    Organizing for these should be pretty easy since most are in blocks and I can apply the same keywords quickly.  However, removing the keywords one at a time is a huge pain. 
    What am I doing wrong?
    Thanks

    First, if I choose the 'File Later' keyword, it will pull up the metadata filters options on the top of the grid view.  No matter what I do, I can't make it go away.  If I do get it to go away, I wind up viewing ALL my pictures which is not what I want.
    This is the filter dialog - of course if you close it you turn back to All Photographs. Try creating a Smart Collection based on your File Later keyword - this collection will automatically populate all your images that have that particular keyword. Once you have keyworded the pictures from e.g. one particular shot, just remove the File Later-KW and those images will disappear from the collection.
    Second, if I choose multiple pictures by ctrl-clicking or shift-clicking, It appears I can assign a keyword to multiple shots.  I cannot REMOVE a keyword from multiple shots. Lightroom seems to only want to remove the keyword from one picture at a time even if they are all selected.
    I'm not sure why you can't remove keywords from multiple images - it just works fine here by selecting multiple images and delete the keyword.
    Most of the times I use the Keyword List to assign/delete keywords because in my opinion it is the easiest way - I just browse thru my list or filter for a particular kw and tick the box on the left.
    Creating a hierarchical keyword list can further simplify your work. For example the location: organize the final keyword xyz-Soccer Stadium into other keywords like Town>County>State>Country>Continent>Places, then you only have to tick the last keyword xyz-Soccer Stadium and with that assign all of those keywords in the hierarchy (I know thats kind of a complicated explanation...but I suggest you play around a bit and then you will get the full picture ).

  • Keyword filtering Bridge 2.1

    I migrated from Elements to Bridge and found a difference in the way Bridge filters keywords compared to Elements. Example: I have 3 images with assigned keywords: image1 (keyword1), image2 (keyword2), image3 (keyword1, keyword2).
    If I check keyword1 I get image1 and image3 in Bridge and Elements. However if I also would check keyword2 (in addition to keyword1) Elements would only display image3 whereas Bridge would display image1, image2, image3.
    Is there any way in Bridge to mimic Elements behavior?
    Thanks

    The filter will match across categories (for example jpeg, portrait and 5 stars will return only files that meet all of the criteria), but selecting multiples in a single category will display any file that meets one or more of the selected criteria. (for example several keywords)
    This, as stated earlier, is not that convenient if you want to match on keywords.
    A point to Tom's statement about having to force Elements to write metadata. I used Elements 5 and to my knowledge never requested a write to metadata, yet the keywords were all present in the metadata when I called these into Bridge. It is possible that there was some preference check box that said to do that, but I never consciously forced that or set that.

  • I have two related keyword problems.  Some keywords get "broadcast" to every photo in an event.  It's almost impossible to delete these keywords from individual photos.  I select the keyword, hit delete and it reappears after a few seconds.

    I have two related problems with keywords in iphoto 11.  Sometimes, keywords get magically "broadcast" to every photo in an event or album.  It's difficult to delete these keywords.  If I select one and try to delete it it vanishes.  About half the time, it reappears again either in a couple of seconds or after I go to another photo and then return to the previous one.  When thios happens, I need to delete the keyword two or more times before it actually vanishes.  With several hundred photos in an event that all have a bad keyword, this is a tedious process.  I've tried rebuilding the library once, but with only the first (I think) option checked on the rebuild.

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • Keyword consolidation

    Can anyone offer any help, suggestions, erm... plugins?
    Over the last few years I've built myself an extensive keyword hierarchy in Lightroom - several thousand keywords in it - works well for me.  Since LR3 is able to handle larger catalogs, I've recently imported my pre-lightroom images.  Import worked fine, the only problem is these images were keyworded prior to having a keyword hierarchy.  This means that all the keywords have appeared at the top-level of the hierarchy.  I now have literally thousands of duplicate keywords in my catalog.  And in for reasons I won't bore you with several hundred triplicate keywords, all of which need to be consolodated.  In fact there are so may duplicates at the top level that I the list is longer than lightroom can display in the panel.
    Because the 'duplicates' are at the top level finding the duplicates is easy.  Here's the steps I'm taking to consolodate the keywords.....
    1. look at duplicate keyword in the top level.
    2. Click the arrow to display the images assigned to the duplicate keyword
    3. type the keyword name into the "filter keywords" box
    4. locate the master keyword from the list of filtered keywords (this only works providing the duplicate keyword isn't a synonym as there is a current bug that prevents synonyms from being filtered this way - that bug really isn't helping this!).
    5. Drag the images from the grid onto the master keyword.
    6. Delete the duplicate keyword from the top level
    As an estimate I have at least 3000 duplicates/triplicates that I need to consolodate.  Providing I don't mis-click or mis-type the above process takes about 70secs per consolodation.  By my estimate that would take 60 hours of clicking and typing to complete the consolodation.
    Can anyone suggest any ways to speed this up?  I've looked at Rob Coles keyword consolidator, but that just tells me what needs consolodating and doesn't actually do any of the work.  (In my case I already know which keywords need consolodating - it is manually doing the work that is the problem.
    Thanks,
    Ian

    3bells wrote:
    I'm wondering if your KeywordConsolidator would work with Lightroom 4?
    In a word: Yes , but please contact me directly if any issues spring up - thanks:
    PM: http://forums.adobe.com/people/areohbee
    or: http://www.robcole.com/Rob/ContactMe
    R

  • Is there a maximum number of keywords in Lightroom 4 on Windows XP?

    A friends finds that near the end of a long list of keywords in the Keyword List pane, the right-pointing arraow to the right of the keyword fails to appear. If she adds three new keywords above that point, the point moves up three, suggesting a maximum number of keywords.

    This may be related, but her problem is not that the list is cut off. She can see all her many keywords. It is that, as she gets near the end of the list, she loses the ability to use the right-pointing arrow to the right of the keyword. The arrow doesn't appear. Above a particular keyword, it is always there, but below that keyword it never appears. If she adds new keywords near the top of the list, the point at which the arrow disappears changes, maintaining its position relative to the top of the list, but moving up relative to the bottom. This suggests there is a fixed maximum distance, in numbers of keywords, from the top of the list that the arraow is functional.
    Using hierarchichal (where's the spellchecker when you need it!) keywords might change the distance, in number of keywords, though I don'y think it suits her purposes.

  • Some Adventures With Keywords

    I like many features of the Keyword system supplied with Aperture very much. But there are a few things which have been a little frustrating.
    * The way the autocompletion feature works in the "Add Keyword" field in the Control Bar makes it too easy to misenter a keyword. You type your keyword, hit "Enter", and--oops--you've entered something you didn't mean to enter.
    * Keywords entered in the HUD sometimes capitalize themselves when you don't want this. I haven't been able to determine why this happens, but I can't really understand why I would ever want the program to capitalize a word I didn't capitalize myself. Sometimes this is really frustrating--if I already have a keyword in the HUD, like "lake", and try to enter a phrase like "Kabetogama Lake" in the Control Bar field, Aperture simply won't let me make the "l" in lake uppercase no matter what I try.
    * When you apply a keyword via the Control Bar field, if it doesn't exist in the Keyword HUD Aperture automatically it. Many times I do not want this, and there ought to be a preference to allow turning this off.
    * The "keyword checkbox" interface of the Search HUD does not scale very well. As long as the pictures selected only contain a dozen or two unique keywords, this is fine, but when there are many all of the checkboxes and keywords overwhelm the HUD. Also, the HUD for some reason cannot be made wide enough to show long keywords after each checkbox, no matter how wide the screen on which it is displayed is.
    * In my library, the search HUD shows multiple checkbox items with the identical keyword. Interestingly, selecting one or the other provides different results from the search. However, entering the phrase in the "Quick Search" field does return the correct picture subset. Perhaps rebuilding the library would help with this problem.
    * I thought that the point of the hierarchical structure of the Keywords HUD would make it automatic to enter mutiple keywords which were related. For example, if I have a keyword of "tree" with a subcategory of "oak" I thought you would automatically get "tree" when you applied "oak" to a picture or pictures. Unless I'm missing something there is no way to do this. May a modifier key held down while dragging a keyword to a picture could add the parent keyword(s) as well.
    Has anyone else had similar experiences?

    Here is another issue with keywords.
    Why is a search using a single keyword so slow? On my PowerBook, a search of a relatively small library--1500 images--takes in the neighborhood of 17-20 seconds. How can it take this long? A similar search of my full library (about 7000 images) using Portfolio 7 is virtually instantaneous. The graphics card surely can't be blamed for this one. This is, after all, the company which highlights their Spotlight technology...
    Two other nits. First, it's not clear when the search is complete. There's no progress bar or other indication of completion, so sometimes when you do a search, a group of pictures appear and you think it's done, but suddenly more images appear. Then you wait a while until you feel certain it must be done.
    Secondly, when a search is finished and the subset of images which were found is displayed, there's no indication that it's not the entire project or libarary, particularly when the Search HUD is dismissed. For example, it just says "104 images displayed", rather than "104 of 1500 images displayed" or something like that. It ought to be very obvious that you are not viewing the entire container of images.

  • Can you help with RoboHelp Version 11: WebHelp Index Keyword Sorting?

    I'm new to RoboHelp 11, and I am finding it difficult to alphabetize topics listed under my Index Keywords. When I look at the keyword topics in my RoboHelp HTML editor, they are listed in alphabetical order (see the Tools topic in the first image), but when I generate WebHelp the Tools topics are not in the correct order (second image). I believe that the problem pertains to new entries made to a converted RoboHelp Version 6 WebHelp application. Basically, I have been adding content to several old version 6-generated html files in the new RoboHelp HTML editor.
    Another issue that's perplexing is the fact that the Move Up and Move Down icons at the top of the Index editor pod, or whatever it's called, are grayed-out (not functioning). I remember with the Version 6 application, they worked fine.
    Can anyone offer any suggestions on how to get the index alphabetized? I appreciate your help.

    Hi, pweb248
    Just an expansion of what Rick has suggested. Binary index is only used when Microsoft HTML Help "CHM" is your primary layout. So, because WebHelp is your primary layout, Binary should definitely be unchecked. Selecting the Index file (HHK) is fairly standard for WebHelp use and it is sorted numerically and alphabetically by default. The HHK file contains all the Index keywords and their topic associations all tucked into one file, whereas adding Index Keywords using the "Topic" radio button embeds the coded reference right in the topic html file itself.
    This online help topic explains a little more about the Sorting options depending on the primary layouts and whether Binary is selected.
    Adobe RoboHelp 11 * Edit index keywords
    This is the key paragraph:
    >>Note: The Sort command is unavailable with a binary index. The sort function is enabled only when the primary layout is HTML Help and the Index is set to Index File with no Binary Index. In all other layouts, the index remains sorted but for HTML output, the sorting of the index can be changed. Sorting enables the up and down keys on Index Pod.<<
    As you have noticed, your Index Designer view is apparently working as documented. I share your puzzlement about the out-of-sort listing in the WebHelp output shown in your screenshot. I wonder if there is some left-over crud from the ancient RoboHelp 6 code that is not converted properly and gumming up the works? Also curious if you have more than one Index in your project and if you are selecting the right one in the WebHelp Settings > Content dialog. Maybe Rick, Peter or Willam can shed some light on this?
    John

Maybe you are looking for

  • ITunes 11.1.4.62 for Windows Breaks iTunes Match

    After upgrading to iTunes 11.1.4.62 for Windows 7 Ultimate 64-bit, my iTunes Match no longer works.  It insists that I pay for another subscription even though I have a valid subscription already.  This issue has been going on for over a week with no

  • Pin-to-Pin I/O

    Is the pin-to-pin I/O of the 777384-01 identical to the AT-MIO-16E-2 and if not what differs?

  • I have an iphone 5c can i install ios 8.0.2?

    I Have an iphone 5C is there any problem if I update the software ios 8.0.2?

  • Images unstable in preview

    Have Aperture version 3.5.1 on Mac Pro version OS X 10.9, various file formats (RAW, Tiff or JPG) . When using Aperture w/ split screen (Viewer/browser) images jump w/o clicking to change in browser. When working on image in viewer it suddenly change

  • How do I install FCP6 LiveType presets in FCP7

    OK, I upgraded OS X to 10.5.8. I installed FCP 7 and dumped FCP 6. Now a nice little project I am working on for a client doesn't see the clever LiveType preset on one of the title pages. The letters jumped around beautifully for me. I don't think I