Code example for AtomicReference

Methods: getAndSet

0
    /** @param command 'Active' command to highlight 
     *  @return Previous active command 
     */ 
    public synchronized ScanCommand setActiveCommand(final ScanCommand command)
    { 
        return active_command.getAndSet(command);
    } 
 
    /** @param command {@link ScanCommand} in current cell 
     *  @return Text to display 
     */ 
    public String getText(final ScanCommand command)
    { 
        // Add space between image and text 
        return " " + command.toString(); //$NON-NLS-1$
    } 
 
    /** @param command {@link ScanCommand} in current cell 
     *  @return Image to display 
     */ 
    public Image getImage(final ScanCommand command)