Sitemap

Amicuk Programming Answers

For good Method

-0001-11-30   Views:0

Advertisement

Hi All, I want to add some sequence number to Vector container. for example, 3,4,5,6,7,8,9,10 how to make best way to add those number to container, I do not like the following code for(int i=3;i<11;i++){     container.add(i); }the thing is, I do a q

Hi All,
I want to add some sequence number to Vector container.
for example, 3,4,5,6,7,8,9,10
how to make best way to add those number to container,
I do not like the following code
for(int i=3;i<11;i++){
    container.add(i);
}the thing is, I do a quick search on an object array, i get the start Index, and end Index.
since maybe there is a lot of records match the search conition, let me see, 3,000.
Any hint would be great appricated.
Thanks in advanced!

The replay answer
Advertisement
Hi,
As from ur question, i can see that ur trying to hold the premitive values,
if you need to hold primitive types, arrays are the way to go, since the collection classes can only hold instances of Object. The class java.util.Arrays includes some useful algorithms for processing arrays,
And in case if ur using the objects, Array list would be the bettter option, Just find the below link why arraylist is better,
http://java.sun.com/developer/TechTips/txtarchive/2002/Sept02_GlenM.txt
Bhuvan

Go to See the other 6 answers

Error while calling a method on Bean (EJB 3.0)

Category:DefaultRelease time:2015-10-11Views:130

I am getting an error while calling a method on EJB. I am using EJB3.0 and my bean is getting properly deployed(i am sure b'cos i can see the successfullly deployed message). Can any body help me Error is --> Error while destroying resource :An I/O e[More]

Issue with SharePoint foundation 2010 to use Claims Based Auth with Certificate authentication method with ADFS 2.0

Category:DefaultRelease time:2015-10-11Views:130

I would love some help with this issue.  I have configured my SharePoint foundation 2010 site to use Claims Based Auth with Certificate authentication method with ADFS 2.0  I have a test account set up with lab.acme.com to use the ACS. When I log int[More]

Using G_SET_GET_ALL_VALUES Method

Category:DefaultRelease time:2015-10-11Views:130

Hi, I need to use the following method. G_SET_GET_ALL_VALUES. But I'm not sure of the data type that it returns. CALL FUNCTION 'G_SET_GET_ALL_VALUES'   EXPORTING   CLIENT                      = ' '   FORMULA_RETRIEVAL           = ' '   LEVEL         [More]

Clearing values from request in decode method

Category:DefaultRelease time:2015-10-11Views:130

I am using a custom table paginator. In its ‘decode’ method I have the next code to control whether ‘next’ link is clicked: String pLink = (String)requestMap.get("pLink" + clientId); if ((pLink != null) && (!pLink.equals("")))[More]

Method all values from row

Category:DefaultRelease time:2015-10-11Views:130

Hi, Is there a method that get the all the values of a row? I've gone through the java api but didn't found one, but wanted to be sure. If not I'll have to do getValueAt for every column? GrtzHere is one possible implementation using RowTableModel (a[More]

How can I move an ArrayList from one method to another?

Category:DefaultRelease time:2015-10-11Views:130

As the subject reveals, I want to know how I move an ArrayList. In one method, I fill my ArrayList with objects, and in the next I want to pick an arbitrary object out of the ArrayList. How do I make this work??You pass the same array list to both th[More]

HT1918 Can I have multiple payment methods on one account

Category:DefaultRelease time:2015-10-11Views:130

Currently, both of my teenage sons and I are sharing an Apple account with one payment method. I would like to have a payment method for each of us.If they are teenagers, it is not too soon to set up individual accounts per person.  This will address[More]

A method to convert an existing iCloud account to a Child iCloud Account for Family Sharing

Category:DefaultRelease time:2015-10-11Views:130

I do not see any method by which to convert an existing iCloud account (we have three set up for our kids, all their birthdays are set later than their actual birthdays so we could grab their actual names before they were all gone years ago) to a new[More]

How can i execute ejb method in a servlet?

Category:DefaultRelease time:2015-10-11Views:130

hi I am using a IBM HTTP Server and Weblogic Server. I could execute below source in a main method of application but i could not that in a init method of servlet because of ClassCastException. (a classpath of weblogic contains client's classpath) //[More]

Can I use classes and methods for a maintenance view events?

Category:DefaultRelease time:2015-10-11Views:130

Hello experts, Instead of perform/form, can I instead use classes and methods, etc for a given maintenance view event, lets say for example I want to use event '01' which is before saving records in the database. Help would be greatly appreciated. Th[More]

How to call a specific method in a servlet from another servlet

Category:DefaultRelease time:2015-10-11Views:130

Hi peeps, this post is kinda linked to my other thread but more direct !! I need to call a method from another servlet and retrieve info/objects from that method and manipulate them in the originating servlet .... how can I do it ? Assume the origina[More]

Hot
I'm trying to move applications from my Titanium PowerBook G4 (OS X 10.4.7) to my MacBook by booting the G4 in Target Disk Mode. I can get the icon representing the G4's HDD to appear on the MacBook's desktop, but sometimes when I double-click to ope [More]
What are the major process to transfer the data from legacy to sap system using BDC at Real Time only?hi, BATCH DATA COMMUNICATION main methods are: 1. SESSION METHOD 2. CALL TRANSACTION 3. DIRECT INPUT Advantages offered by BATCH INPUT method: 1. Ca [More]
>Thousands of files (images)have been save to a hard drive under CS, CS2 & CS3 in various formats, such as *.CR2, *.tif, *.psd, *.jpg, *.mrw. >When I attempt to open the images the following messages are returned depending on the file extension: [More]
I just experienced an odd problem with my 6 month old MBP. I left the computer with the lid open and came back 30 minutes later and screen was black, as if it had gone to sleep. However, the sleep light was not pulsing and the computer would not wake [More]
when starting a new website from search or bookmarks it starts with connecting and collecting data from the requested website but it get stuck or is extremely slow. One solution is to click update button several times. Is there a way to solve this pr [More]
Hi I installed oracle 11g & create database , now i want to use fully optimize database. Currently my DB server RAM is 16GB, how should i allocate SGA for this.If i used oracle 11g automatic memeory management feature to allocate SGA+PGA, how should [More]
I have a Toshiba L355 S7811 laptop (Vista Home Premium). I've used it for several years now but lately, it will not boot to normal Windows but to Safe Mode with network support. If I try to load it normally, it resets itself but, using Safe Mode it w [More]
Hi, Is there any standard api to retrieve the java program's class name, method name, its parameter, code etc... My req is to write a java program that takes any java programme file as input and returns the class name, method name, parameter name and [More]
Hi, I am new to JDI and I want to create a debugger to listen to events like ClassUnloadEvent . I start the application that I want to debug with: java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=80000 <mailclass> is this correct ? I than [More]
Hi , i am doing trasnport the ztable Entries using below process In the transport request add an entry R3TR - TABU - <tablename> chose program id R3TR then object type TABU and also the right table name. But After this Process.. what i want to do.. [More]