How do you determine StringBuffer and List capacity?

hi all,
I'm curious and would like to post this query that how to determine the StringBuffer and List capacity after read some of the Java Platform performance book. Some of this performance books simply tells number of capacity brieftly without telling what and how does the capacity stand for.
First, the book mentioned StringBuffer(50). Note, my question is that what is this 50 stand for? 50 Characters? or any. Can someone help me to rectify this?
Second, List. ArrayList(0.75). And what is this 0.75(by default) stand for? A heap space? Then how many of them? How many objects that can be stored for not to "exceed 0.75"?
Please help. :)
regards,
Elvis
scjp

I think the capacity is the CURRENT size of a container. But it is not equal to the number of elements that container currently hold. Just like, a house can have 10 people within, but problably only 3 people at some time. Also, the capacity is not equal to the maximum size, because container can grows automatically.
For example, a container whose capacity is 50, currently has 30 elements in it. If you add 10 elements more. That is only an addition operation. But if you add 30 elements to it. Then the container first enlarge its capacity according to some arithmetic(a enlarging rate), secondly carry out the addition operation.
Now that the capacity is the size, it should be a number standing for HOW MANY elements.... In the case of StringBuffer, it should be how many chars; in the case of ArrayList, it should be how many Objects. I do not think 0.75 can stand for a capacity. Prabaly, it was used to describe the enlarging rate when containers need to contain more elements than its current capacity. ( From JDK API, you can see the type of capacity is int ).
For containers and alike, the questions "how many I can hold" and "how many I am holding", "Do I can enlarge"? are helpful for understanding how it works.

Similar Messages

  • How do you determine ip and op buffer size on a 3550-12G

    I have a Cisco 3550-12G switch and I want to check to see if the input buffers and the output buffers for port gi0/12 are the same size. Is there a simple way to do this, I tried using the show buffers command but I couldn't seem to find what I was looking for. Help!

    Hi,
    "The 3550 switch uses central buffering. This means that there are no fixed buffer sizes per port. However, there is a fixed number of packets on a Gigabit port that can be queued. This fixed number is 4096. By default, each queue in a Gigabit port can have up to 1024 packets, regardless of the packet size."
    http://www.cisco.com/warp/public/473/187.html#topic7
    HTH,
    Bobby
    *Please rate helpful posts.

  • How do you determine remaining capacity on ipod shuffle

    How can you determine remaining capacity on ipod shuffle?

    I tried this and did not see anything in iTunes. I'm not the smartest guy on the block when it deals with computers. Hey i'm 73 years young!! Thanks for your help anyway.

  • How do you determine the optimal size for Mozilla Firefox?

    How do you determine the optimal size for cache in Mozilla
    Firefox? I am using Firefox 7.0.1 on a 64-bit Windows 7 Ultimate operating system with 3GB RAM and 300 GB hard drive, but I have other computers running Windows XP. If the answer doesn't apply to all current versions of Firefox on all supported Windows operating systems, please explain the differences. Is there a formula for calculating the best cache size?

    I found that the best idea is to let Firefox decide that itself.

  • How do you determine the picture that is shown on iTunes for your podcast?

    How do you determine the picture that is shown on iTunes for your podcast? Is that done in iWeb or Garagetunes?

    That is a supported format,
    Pull the battery while the device is ON, replace after a minute, Let the device reboot 1-3 min,
    see if the problem is fixed,
    If not we may have to reload the device OS to get back the missing option.
    Thanks,
    If you need more info please ask!  If not please resolve the thread using the options by the Kudos’ star, Just place the check in the Post that answered your question, Thanks
    Click Accept as Solution for posts that have solved your issue(s)!
    Be sure to click Like! for those who have helped you.
    Install BlackBerry Protect it's a free application designed to help find your lost BlackBerry smartphone, and keep the information on it secure.

  • How do you determine what shows are in free video on demand?

    How do you determine what to include in the free on-demand shows?  The Mentalist was always there before but is no longer.  This is especially important for shows like the Mentalist and The Good Wife which come on Sunday nights after sports events.  Even if I set my DVR to record 60 minutes over it doesn't always catch the entire episode.  Would also like to see Person of Interest  there.   And last but not least, you should have a way for people to access netflix or other services from your service.  

    If you go to BROWSE then the FREE folder you will find that everything in there is free viewing. If you go elsewhere and try to watch a paid show, you will get a prompt asking you to purchase. It also shows the amount of the movie before purchase.
    Anthony_VZ
    **If someones post has helped you, please acknowledge their assistance by clicking the red thumbs up button to give them Kudos. If you are the original poster and any response gave you your answer, please mark the post that had the answer as the solution**
    Notice: Content posted by Verizon employees is meant to be informational and does not supersede or change the Verizon Forums User Guidelines or Terms or Service, or your Customer Agreement Terms and Conditions or plan

  • How do you determine resolution for a given print size in LR?

    CS3 displays image resolution for a given size. How do you determine what that resolution is in LR for a given print size, so you know whether you should upsize or downsize for optimum print resolution range?

    The only way I know of is to work it out. LR and PS make assumptions that are often not ideal (although the differences may not be noticable). Different printers like different resolutions per inch. For example, I once had an Olympus Dye Sub printer that produced awful prints unless the file was exactly 314 ppi. Not 300, 314. 300ppi looked awful. 314 looked amazing. Many Canon inkjets prefer 300ppi files and most of the better Epson's prefer 360ppi. Lambda printer like 400ppi files.
    So find out what the printer likes, and in LR enter that number into the printer dialog. I believe the LR engine interpolates the file based on this and the image size on paper you choose to produce a file of the best size.
    Having said all that with most modern domestic and prosumer inkjets the difference is pretty negligable.
    Gordon

  • How do you determine which programs or processes run following a reboot?

    How do you determine which programs or processes run following a reboot?  Also when you reboot Mac tries to reopen anything running before the reboot.  Is there any way to turn off that functionality?

    10.7 Lion
    dadpope wrote:
    How do you determine which programs or processes run following a reboot?
    Login items
    Follow the  instructions in this article.
    http://support.apple.com/kb/PH4333
    Also when you reboot Mac tries to reopen anything running before the reboot.  Is there any way to turn off that functionality?
    System Preferences > General
    Section: Number of recent items
    Uncheck the box for "Restore windows when quitting and re-opening apps".

  • How do you determine transportation planning point

    Hi Gurus,
    Badly need your help.  How do you determine transportation planning point?
    Thanks,
    Paul

    Dear John
    It is based on routes and route schedules are determined based on the following conditions:-
    => Shipping point
         Where are the goods coming from?
    => Ship-to party and unloading point
         Where are the goods going to?
    => Shipping condition
         How are the goods being shipped?
    => Transportation group
         Which goods are shipped?
         --> For example, which type of goods?
    => Calendar week / year
          When are the goods to be shipped?
    If you do not explicitly enter the week and the year, the entry applies for each calendar week. If you enter a week and a year, the route schedule only applies for this week.
    You can only use route schedules if you have maintained the working times and therefore at least one of the following times in minutes:
           -> Transportation planning time
           -> Pick/pack time
           -> Loading time
           -> Transit time
    A route schedule can leave the warehouse exactly once in a week. If a route schedule runs several times, either on several days or several times a day, it must be copied to another route schedule.
    Thanks
    G. Lakshmipathi

  • How do you print the reminder list

    How do you print the reminder list?

    With Reminders open and your list you'd like to print select, press command "A". After that copy them (command "C"). After that, open your Text Edit app. Once that is open, paste your copy in there (command "V"). From here you can print like you normally do.

  • How do you alphabetise a bulleted list

    How do you alphabetise a bulletted list?

    Donnie Ashworth wrote:
    You have to first convert the list to a table (Format / Table / Convert List to Table)
    Then select a cell in the table, open the table inspector, click on "Table", then go to the Edit Rows & Columns pop-up, and choose Sort Ascending or Descending, whichever you want.
    If you want to then alter the table borders so it doesn't look like a table, you can do that also.
    OR
    You could then convert the Table to Text (Format > Table > Convert Table to Text)
    Regards,
    Barry

  • How do you combine audio and video files?

    I've brought in a video file and an audio file, but can find no way to specify that they are a single source that should be compressed together.  The documentation was of no use.  How do you identify video and audio files as being one source?
    Thanks!

    Semantics, I suppose.  In any case, you do need to go through Premiere Pro if you want AME to do the job.  There are likely other encoders out there which can perform the muxing, though, if you'd rather not go through PP.

  • How do you clear system and application logs in a server?

    Hello all,
    How do you clear system and application logs in a server?
    thanks,
    mike

    go to start button,all programs,assosories, System tools T event viewer. now select application & rt click & clear & do not save.similarly do for sytem too.

  • How do you determine the firmware version for a laptop docking station?

    How do you determine the firmware version of a HP docking station?
    Laptop Model: HP 2740p
    OS: 64bit Windows 7
    Expansion Base: 2740 Ultra Slim Expansion Base WA995AA#ABA
    Thank you for any assistance.
    Alvin

    atenpo wrote:
    How do you determine the firmware version of a HP docking station?
    Laptop Model: HP 2740p
    OS: 64bit Windows 7
    Expansion Base: 2740 Ultra Slim Expansion Base WA995AA#ABA
    Thank you for any assistance.
    Alvin
    WA995AA#ABA shows to be a hard drive, not a docking station

  • How do you import media and metadata from Windows Photo Gallery database?

    How do you import videos and photos and their metadata from a Windows Photo Gallery database into the Elements Organizer, especially metadata that is only contained in the Photo Gallery database file (pictures.pd6) and not embedded in the video and photo media files themselves?
    And when you import the metadata into Organizer, do you get all of these available elements?
    Ratings
    Tags
    Captions
    People tags
    Geotags
    Also, if the media files in Organizer are ever moved to another PC, is there a way to migrate all of the Organizer's metadata with the files to use with another instance of Premiere Elements?

    OK.  I think we're getting close to the answer.
    The reason I'm asking about this is because for Photo Gallery, media files can NEVER be moved without losing all database metadata.        I'm sorry I didn't know this when I started with Photo Gallery and I think I've learned an important lesson:  Be sure you can move your work BEFORE you start.
    So, to clarify Organizer's behavior, let me ask the question another way.  Let's say that in a few years, after I've added tags, people, places, etc. to hundreds of media files in Organizer, I decide to get a new PC.   When I move all that stuff to my new petabyte drive on the new PC, do we know if Premiere Elements Organizer on the new PC would be able to read the original Organizer's metadata?

Maybe you are looking for