Remove duplicate entries in a Vector in java

One of the solution which normally every java developer faced once.We have to remove the duplicate
value from a vector in java.

There are two solution for it one.

1.

Vector newVect = new Vector(new LinkedHashSet(originalVect));


or this, if you do not need a new Vector object created

2

Collection noDup = new LinkedHashSet(vectorContainingDup);
vectorContainingDup.clear();
vectorContainingDup.addAll(noDup);

In both cases we puting duplicate vector in linkedHashSet , which will remove the duplicate values.

Enjoy coding 🙂 with techartifact………………………….

Q: What are different Task Flow Component?

Method call-Provide a way to execute code within the flow.
Router – Provided way to branch the flow based on condition or by el.
Save Point Restore: Allows developer to take a snapshot of and ,then resotre,application state at specific point in flow.
Task Flow Call-Allow task flow to be called from this task flow.
URL View-Way to reach out the flow and potentiallu out og web application to some arbitrary URL such as http://www.techartifact.com
View:Allow display of page and page fragment.
Control Flow Case: Define flow between two activies.Similar to navigation case in ADF 10g or default jsf navigation engine.
WildCard Control Flow Rule: Provides way to define an origin for one or more global control flow cases that are shared and available from multiple activities on the diagram.

Different memory scope in Oracle ADF

Application: The application scope lasts until the application stops. Values that you store in a managed bean with this scope are available to every session and every request that uses the application.

session: The session scope begins when a user first accesses a page in the application and ends when the user’s session times out due to inactivity, or when the application invalidates the session.
The session scope begins when a user first accesses a page in the application and ends when the user’s session times out due to inactivity, or when the application invalidates the session. Use this scope only for information that is relevant to the whole session, such as user or context information. Avoid using it to pass values from one task flow to another. Instead, use parameters to pass values between task flows. Using parameters gives your task flow a clear contract with other task flows that call it
or are called by it. Another reason to avoid use of session scope is because it may persist beyond the life span of the task flow.

pageFlow: this is accessible across the activities within a task flow. A managed bean that has a pageFlow scope shares state with pages from the task flow that access it. A managed bean that has a pageFlow scope exists for the life span of the task flow.If another task flow’s page references the managed bean, the managed bean creates a separate instance of this object and adds it to the pageFlow scope of its task flow.
Choose this scope if you want the managed bean to be accessible across the
activities within a task flow. A managed bean that has a pageFlow scope shares
state with pages from the task flow that access it. A managed bean that has a
pageFlow scope exists for the life span of the task flow.
If another task flow’s page references the managed bean, the managed bean
creates a separate instance of this object and adds it to the pageFlow scope of its
task flow.

backingBean: A backing bean is a convention to describe a managed bean that stores accessors for UI components and event handling code on a JSF page. It exists for the duration of a request and should not be used to maintain state.Use this scope if it is possible that your task flow appears in two ADF regions on the same JSF page and you want to isolate each instance of ADF region.
A backing bean is a convention to describe a managed bean that stores accessors for UI components and event handling code on a JSF page. It exists for the duration of a request and should not be used to maintain state.Use this scope if it is possible that your task flow appears in two ADF regions
on the same JSF page and you want to isolate each instance of ADF region.

view :Use this scope for managed bean objects that are needed only within the current view activity and not across view activities. It defines scope for each view port that ADF Controller manages, for example, a root browser window or an ADF region.The life span of this scope begins and ends when the current viewId of a viewport changes. If you specify view, the application retains managed bean objects used on a page as long as the user continues to interact with the page. These objects are automatically released when the user leaves the page.

Request : Use request scope when the managed bean does not need to persist longer than the current request.