recitation 3 n.
Skip this Video
Loading SlideShow in 5 Seconds..
Recitation 3 PowerPoint Presentation
Download Presentation
Recitation 3

Loading in 2 Seconds...

play fullscreen
1 / 5

Recitation 3 - PowerPoint PPT Presentation

  • Uploaded on

Recitation 3.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Recitation 3' - alan-gilbert

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
recitation 3

Recitation 3

In this assignment you will write a program to pick up the uppercase letters in an input string. It is pretty much like the program in the lecture, but this time it should be implemented as a bean class that implements an interface. And you also need to use ObjectEditor to enter the input string and to get the uppercase string, which is a string consisting of all of the upper case letters in the input string.


The code of the main method is provided. So you need to name the class and interface accordingly (class name: AnUppercaseFilter. Interface name: UppercaseFilter).

Also note the import statement and “ObjectEditor.edit(filter)”. Later you will need the code to use ObjectEditor in homework.

import bus.uigen.ObjectEditor;

public class Driver {

public static void main(String[] args){

UppercaseFilter filter = new AnUppercaseFilter();

filter.setString("Initial Input");





To follow the bean pattern, you should have two string properties, one for the input string and another for the uppercase letters string.

You also need two getter methods for each of the properties.

Since the input string is the user specified variable while the uppercase letter string is not, you should only have one setter method, which is for the input string.

You can either put the code for picking up in the getter method or in a separated method.


To let the ObjectEditor recognize the bean class, you need to add annotations above the header of the class.

The annotations are:



@StructurePattern("Bean Pattern")

The purpose of these annotations is to let the ObjectEditor know what type of the object is , and display the object according to its type.

In future homework you will use annotations to draw rectangles and lines on ObjectEditor.


Bean Pattern:



It is helpful to review the code of BMICalculator, which is in these two slides.