Help to calculate the size of arraylist..........

class hdrFileFilter extends FileFilter {
private Hashtable filters = null;
private Hashtable noextensionfilter = null;
private String noextensionname=null;
private String extensionname = null;
private String description = null;
private String fullDescription = null;
private boolean useExtensionsInDescription = true;
private String fname = null;
public ArrayList noextensionarray=new ArrayList();
private File x;
int count=0;
int counthdr=0;
int i=0;     
     //all files are accepted.
public hdrFileFilter()
     this.filters = new Hashtable();
     //Creates a file filter that accepts files with the given extension.
public hdrFileFilter(String extension)
     this(extension,null);
     //Creates a file filter that accepts the given file type.
public hdrFileFilter(String extension, String description)
     this();
     if(extension!=null)
     addExtension(extension);
     if(description!=null) setDescription(description);
}      //Return true if this file should be shown in the directory pane,false if it shouldn't.
public boolean accept(File f) {
     if(f != null) {
     if(f.isDirectory()) {
          return true;
     String extension = getExtension(f);
     if(extension != null && filters.get(getExtension(f)) != null)
          fname=f.getName();
          extensionname=fname.substring(0,fname.lastIndexOf('.'));
          counthdr+=1;
          return true;
     if(extension == null)
          noextensionfilter=new Hashtable(20);
          noextensionname=f.getName();          
          noextensionfilter.put(count,noextensionname);
          count+=1;
          if(noextensionfilter.get(count) == extensionname)
               //noextensionarray=new ArrayList();
               x=f;
               noextensionarray.add(x);
               System.out.println("file:" +noextensionarray.get(i));                //i++;
               return true;               
     return false;
[b]public int get_size()
     int xx=noextensionarray.size();
     return xx;
     System.out.println("size is:" + noextensionarray.size());
     //Return the extension portion of the file's name .
public String getExtension(File f)
          if(f != null)
               String filename = f.getName();
               int i = filename.lastIndexOf('.');
               if(i>0 && i<filename.length()-1)
                    return filename.substring(i+1).toLowerCase();
          return null;
     //Adds a filetype "dot" extension to filter against.
public void addExtension(String extension)
     if(filters == null)
     filters = new Hashtable(20);
     filters.put(extension.toLowerCase(), this);
     fullDescription = null;
public String getDescription()
          if(fullDescription == null)
               if(description == null || isExtensionListInDescription())
                    fullDescription = description==null ? "(" : description + " (";
                    // build the description from the extension list
                    Enumeration extensions = filters.keys();
                    if(extensions != null)
                         Object nn=extensions.nextElement();
                         fullDescription += "." + nn;     
                         while (extensions.hasMoreElements())
                              fullDescription += ", ." + nn;
                    fullDescription += ")";
               else
                    fullDescription = description;
          return fullDescription;
public void setDescription(String description)
     this.description = description;
     fullDescription = null;
public void setExtensionListInDescription(boolean b) {
     useExtensionsInDescription = b;
     fullDescription = null;
          public boolean isExtensionListInDescription()
          return useExtensionsInDescription;
} //end of hdrfilefilter
class reference extends hdrFileFilter
reference()
here i need the size of noextensionarray array List
I've used method get_size() for the calculation of niextensionarray List in above class which is marked as bold.
since I've allocate memory to the array above the hdrFileFileter() so now the array list is showing the zero size of arraylist.
PLS. help me to get the size of arraylist noextensionarray.

Hello all,
the code contain two classes
1. hdrFileFilter: used to filter out files containing the extension .hdr and those files that haVE the same name as the header file has but with no extension.
files that have no extension are stored in the arraylist "noextensionarray".
2. Reference Class: this class is using the files that are stroed in the array List "Noextensionarray" one by one. for this I required the size of arraylist. I'm using the size of array through function get_size it gives the size=0;this function is defined in class hdrfilefilter.although it is diaplaying the name which are stored in arraylist on commad prompt.
I appricate all the comments given regarding the solution of the problem.
class hdrFileFilter extends FileFilter
     private Hashtable filters = null;
     private Hashtable noextensionfilter = null;
     private String noextensionname=null;
     private String extensionname = null;
     private String description = null;
     private String fullDescription = null;
     private boolean useExtensionsInDescription = true;
     private String fname = null;
     public ArrayList noextensionarray=new ArrayList();
     private File x;
     int count=0;
     int counthdr=0;
     int i=0;
     //all files are accepted.
     public hdrFileFilter()
          this.filters = new Hashtable();
     //Creates a file filter that accepts files with the given extension.
     public hdrFileFilter(String extension)
          this(extension,null);
     //Creates a file filter that accepts the given file type.
     public hdrFileFilter(String extension, String description)
          this();
          if(extension!=null)
          addExtension(extension);
          if(description!=null) setDescription(description);
     } //Return true if this file should be shown in the directory pane,false if it
shouldn't.
     public boolean accept(File f)
          if(f != null)
               if(f.isDirectory())
                    return true;
               String extension = getExtension(f);
               if(extension != null && filters.get(getExtension(f)) != null)
                    fname=f.getName();                         
          extensionname=fname.substring(0,fname.lastIndexOf('.'));
                    counthdr+=1;
                    return true;
               if(extension == null)
                    noextensionfilter=new Hashtable(20);
                    noextensionname=f.getName();
                    noextensionfilter.put(count,noextensionname);
                    count+=1;
                    if(noextensionfilter.get(count) == extensionname)
                              //noextensionarray=new ArrayList();
                              x=f;
                              noextensionarray.add(x);
                              System.out.println("file:"
noextensionarray.get(i)); //i+;
                              return true;
          return false;
     public int get_size()
          int xx=noextensionarray.size();
          return xx;
          System.out.println("size is:" + noextensionarray.size());
//Return the extension portion of the file's name .
     public String getExtension(File f)
          if(f != null)
               String filename = f.getName();
               int i = filename.lastIndexOf('.');
               if(i>0 && i<filename.length()-1)
                    return filename.substring(i+1).toLowerCase();
               return null;
//Adds a filetype "dot" extension to filter against.
     public void addExtension(String extension)
          if(filters == null)
               filters = new Hashtable(20);
          filters.put(extension.toLowerCase(), this);
          fullDescription = null;
     public String getDescription()
          if(fullDescription == null)
               if(description == null || isExtensionListInDescription())
                    fullDescription = description==null ? "(" :
description + " (";
                    // build the description from the extension list
                    Enumeration extensions = filters.keys();
                    if(extensions != null)
                         Object nn=extensions.nextElement();
                         fullDescription += "." + nn;
                         while (extensions.hasMoreElements())
                              fullDescription += ", ." + nn;
                    fullDescription += ")";
               else
                    fullDescription = description;
          return fullDescription;
     public void setDescription(String description)
          this.description = description;
          fullDescription = null;
     public void setExtensionListInDescription(boolean b)
          useExtensionsInDescription = b;
          fullDescription = null;
     public boolean isExtensionListInDescription()
          return useExtensionsInDescription;
} //end of hdrfilefilter
Class reference
REQUIRED THE SIZE OF ARRAYLIST.
}

Similar Messages

  • How to calculate the size of web forms in hyperion planning?

    Hi Experts,
    I am trying to calculate the size of planning forms in Hyperion smart view., but i am unable to find out the way to calculate.
    Can you pls explain how to calculate the size of web form in Smart view?
    --- Srini.

    Hi Srini,
    First, here is what Oracle says:
    Data Form Size Estimation:
    To get a rough estimate of data form size, open the data form and select File > Save As from the browser. The size of the .HTML file is the portion of the data form that changes based on grid size. The .JS files remain the same size and can be cached, depending on browser settings. Information such as data form definitions, pages, and .gif files are not compressed when data forms are opened and sent to the Web browser.
    I have not been able to find out using their method.
    In any case, you can find out the size of grid by using below
    1. Right click on the form grid and click "View source"
    2. Save the source file as "Example.html"
    3. Right click the saved file and click "Properties"
    4. The Form size whould be same as that of file..
    Let me know if it helps.
    Cheers
    RS

  • To Calculate the Size of Infocube

    Hi ..
       How to calculate the size of the Infocube...?
    I know there is one formula for it...!
    Can any one help me...
    Thanx in Advance...
    Vasu

    hi Vasu,
    calcute the size of infocube
    - total records
    transaction se16 -> fact table name, /bic/f[infocube name] and /bic/e[infocube name] or /bi0/f.. and /bi0/e for business content infocube, click 'number of entries'
    use program (se38) SAP_INFOCUBE_DESIGNS
    - size in bytes
    transaction db02 -> 'detail analysis' -> object name = [infocube name]
    hope this helps.

  • How to calculate the size of the heap memory? its urgent pls

    i had a task in which i need to calculate the size of the heap memory can anybody help me its urgent pls

    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html
    Specifically:
    max/total/freeMemory()
    http://javaalmanac.com/egs/java.lang/GetHeapSize.html?l=new

  • To calculate the size of backup for a particular database in RMAN catalog

    Hi ALL,
    Could you please guide me how I can calculate the size of backup data for a particular database in Recovery Catalog, if I am using Tapes as my backup media for recovery catalog.
    Regards
    Harpreet Singh

    Hi,
    I am not Up to the mark of your question ..
    If you see the V$log you can get it.. Size of the redo logs can be determined either by examining the file system size or by reading the BYTES column on the V$LOG view. Then Check the number of redo Logs avaialble checked whether they are mirrored or etc., Combining the two figures we have a total redo log data at peak in one day. This is the amount of data that any backup facility or storage of Archive Redo Logs would have to take into account. This figure should be mitigated against the fact that manual switching of redo logs means that not all archived redo logs will be the full size.
    - Pavan Kumar N

  • How to calculate the size each PSA request or all PSA for the Datasources?

    Hi All,
    Can anybody tell me how to calculate the size of each PSA Request or all PSA's requests for all datasources?
    Regards,
    Rajesh

    Hi ,
    PSA technical name can be found as,
    1)Right click on your Data Target,go to Display dataflow,click on the PSA ,here you can find the technical name.
    2)Goto RSRV tcode>PSA Table>Consistency between PSA Partitions and SAP Administration-->Give your Infosoure name,it gives u PSA technical name also,
    Thanks&Regards,
    Praveena.

  • How to calculate the size of a Text Field?

    Is there a way to calculate the number of characters allow in a Text Field? If a uer type over this number of characters a popup window will appear telling the user that he/she has too much texts. Of course I could use the Limit Length, but I have to manually put texts into this text field and count them. If the Limit Lenth number is too small, the texts does not fill the whole text field. If the number is too big then the texts does not get printed.

    There would be no easy way to do this. You'd need to do some pretty fancy calculations, it would all depend on the size of the field, what font is used, the font size, whether it's been bolded, underlined, italicized, etc etc.
    What are you trying to accomplish? Make it so that the user can type in the text field until it fills and then have it stop without scroll bars coming up to allow him to keep typing?
    Chris
    Adobe Enterprise Developer Support

  • How to calculate the size and number of nodes in the btree?

    I need to determine the size of the btree nodes in the log file and the how many internal and leaf nodes in the btree. For example if I have 2.88M records approximately how much disk space is used up by the JE's internal structures? This info will help me determine the best size of the data records.

    Chad,
    Keys are stored in order in the btree. They are ordered by the custom comparator if one is used, otherwise by the default (unsigned byte) comparator.
    Key prefixing (when it is available -- remember that we're talking about a future feature here) reduces memory and disk space for the adjacent keys in a Btree node when the initial bytes of those keys are in common.
    If your keys that are adjacent (according to your custom comparator) don't have common bytes at the front, then key prefixing won't have any advantage.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to calculate the size of DB given the transaction and the INVT

    Hi,
    I need to know the size of a database
    transactions/day-900
    Total Items=12,200
    We are preparing for a proposal .The above is the descriptions given by the client.
    How to estimate the size of database We need to design a hardware configuration
    Can anyone help me
    Maran.

    Any clue regarding the size of the row in the 900 transactions per day?
    Will there be a single table updated per transaction or multiple tables?
    Will the transaction be of type insert mostly?
    If it is going to be insert only, then probably you can estimate the database size based on size of row * 900 transactions per day... You need to consider if there will be other tables affected via triggers.
    Also, the size of the indexes defined on these tables will contribute to the database size.
    No idea as to what do you mean by 12,200 items.
    Message was edited by:
    satishkandi

  • Need help to change the size of the Tablespaces.

    Hi DBA's
    Kindly help me on bellow tablespaces, which are the tablespaces need to increase the size in my R12.1.1 Instance? what size should i increase?
    TABLESPACE_NAME SIZEMB FREEMB
    APPS_TS_QUEUES 1000 894.88
    CTXD 19 1.79
    OWAPUB 10 9.92
    APPS_UNDOTS1 1802 4
    APPS_TS_NOLOGGING 64 25.63
    APPS_TS_ARCHIVE 866 367.25
    APPS_TS_TOOLS 500 499.88
    APPS_TS_TX_IDX 7736.75 722.63
    XXKGI 100 99
    APPS_TS_SEED 2982 388.5
    SYSTEM 12012.1328 1169.96
    APPS_TS_INTERFACE 1041 253.63
    ODM 11 1.44
    PORTAL 100 99.53
    APPS_TS_TX_DATA 5680.125 512.63
    OLAP 17.2421875 1.75
    APPS_TS_SUMMARY 1146 253.25
    APPS_TS_MEDIA 1446 276.88
    SYSAUX 472.6875
    Regards,
    SG

    SG,
    Kindly help me on bellow tablespaces, which are the tablespaces need to increase the size in my R12.1.1 Instance? what size should i increase?You are the best one to tell which tablespaces need to be increased (based on your monitoring to the datafile growth). I always keep 30%-40% free space in the tablespaces and get an alert when the used space go beyond that limit.
    Another option is to enable AUTOEXTEND so you do not have to worry (assuming you have enough space at the OS level).
    How To Check For Autoextensible Datafiles Set To Maxsize Unlimited [ID 468096.1]
    How to Determine if a Datafile has AUTOEXTEND ENABLED [ID 1023280.6]
    Thanks,
    Hussein

  • Help with reducing the size of an image but keeping the quality

    Hello,
    I am wondering how do I resize an image but keep the quality. I am creating a folder design for work and I want to include 6 images on the back each of 156px x 118px.
    The images I have are slightly different in size but for example sake one of the images that I have is 225px x 158px. The quality is very poor when I reduce the size.
    I have tried changing the ppi to 72 and to 300, I have also tried resizing all in one go and in a number of goes and I have tried the bicubic sharpener but I have just had no luck with it.
    I am wondering if anyone can help with this,
    Thanks
    Tracy

    Hi Tracy,
    A couple of questions:
    I am creating a folder design for work...
    So this is printed? How large? Pixels are not a unit-of-measure for print.
    If for print, you are looking at ppi of 300 or higher AT PRINT SIZE.
    So, say you want a 3in x 4in picture. That would mean your original would have to be at least 900px X 1200px. (ie 300ppi x width, 300 ppi x height)
    If your original files are not at least that resolution.. . it is hard to add quality after the fact. Unless your are working with vector art.
    I have tried changing the ppi to 72 and to 300, I have also tried resizing all in one go
    Be sure to do that on copies of original. Keep in mind the PPI number by itself is completely meaningless. It only has use in describing a to be printed image when combined with the print size.

  • Help in setting the size of panels

    Hi,
    I am not able to set the size of the panels. I have three panels- steelSettingsPanel, woodSettingsPanel and labourSettingsPanel whose size I set using setPreferredSize function. However, their size does seem to change. I then add the three panels to the dialog as under:-
    Container dialogContainer = dialog.getContentPane();
    dialogContainer.setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    dialogContainer.add(steelSettingsPanel, gbc);
    gbc.gridx = 0;
    gbc.gridy = 1;
    dialogContainer.add(woodSettingsPanel, gbc);
    gbc.gridx = 0;
    gbc.gridy = 2;
    dialogContainer.add(labourSettingsPanel, gbc);
    gbc.gridx = 0;
    gbc.gridy = 3;
    dialogContainer.add(buttonPanel, gbc);
    dialog.setSize(300, 250);
    dialog.setLocation(parent.getX() + dialog.getWidth()/2, parent.getY() + dialog.getHeight()/2);
    dialog.setResizable(false);
    dialog.addWindowListener(this);
    dialog.setVisible(true);
    I have tried not setting the size of dialog but it does not work. When I do not set the size of the dialog to (300,250), I get a very small dialog with nothing in it.
    Any help in this regard would be greatly appreciated.
    Thanks!

    I hope there will not be any note for this.
    Please follow the procedure.
    Go to the domain and Check the domain where it is used and meke sure that it will effect all the tables where it is embeded.
    If you want to change this leangth you have to take the OSS key for that hope you have service.sap login id right.
    There you have to  give the details of that domain object and go for the generate key.
    The domain details you have to provide while generating the key .
    these details we will call it as object directry enties.
    Take all those things and give while you are genereating the key.
    Hope you will do it.
    Regards,
    Madan.

  • How to calculate the size of database (a different one)

    Hello Friends,
    I am told to move the data from server to another machine (cloning is one very good option, I agree. But I expect a different answer regarding exports and imports). so How should I go about the task. The destination machine has got unlimited space. So thats not a problem. My questions are :
    1) How should I start the task ( I generally go for studying the structures and their sizes. Is it ok ?)
    2) If I am using Unix machine and there is a limitation that my server will not support file sizes of more than 2 GB, What should I do ?
    3) Shall I have to go for a full database backup or fragment the task ? If I do that , there are many schemas, so it will become tedious. But full backup will exceed OS size limitation. What should be done ?
    4) Is there anyway, I can go through a dump file, to find out, the database objects present inside that and note the related dependencies.
    Please respond.
    Regards,
    Ravi Duvvuri

    1) They are Unix machines. So will the size problem occur(if there is a limitation). How to overcome that?
    If the OS are of the same version you will have any problem. Regarding the storage only you have to have space in disk to store the datafiles, redo logs and controlfiles and nothing else.
    2) I am trying Export/import measure. Though there are other good methods, I just want to explore the full capabilities of Exp/Imp
    r.- Recreate the controlfiles is more effective and fast if the OS are of the same version.
    3) And the oracle version is 9i 2. (If I have to perform this on 8i (both source and destination, will the methods are going to differ ?)).
    R.- The method is the same for 8i/9i/10g.
    How should I go about doing this export/import ?
    r.- To use this method you have to have the original database started.
    To recreate the controlfile without having the datafile that you mentioned you have to get out it from the CREATE CONTROLFILE sentence and that's it.
    For Example: I mean, if your database has 8 datafiles and you have only 7, you have to include only 7 in the CREATE CONTROLFILE sentence.
    Joel Pérez
    http://otn.oracle.com/experts

  • Help in changing the size of a field length.

    hello,
    i need to change the size of a field in the table PAYR for the field CHECT.
    Present size is 13. I want to make it as 20. Is there any OSS notes for this. If yes, Please let me know how to implement that.
    Thanks
    Senthil

    I hope there will not be any note for this.
    Please follow the procedure.
    Go to the domain and Check the domain where it is used and meke sure that it will effect all the tables where it is embeded.
    If you want to change this leangth you have to take the OSS key for that hope you have service.sap login id right.
    There you have to  give the details of that domain object and go for the generate key.
    The domain details you have to provide while generating the key .
    these details we will call it as object directry enties.
    Take all those things and give while you are genereating the key.
    Hope you will do it.
    Regards,
    Madan.

  • Photoshop Elements 11 help.  Adjusting the size of a JPEG

    Hi everyone.  I am an artist and am having trouble adjusting the size of my JPEGs.  I have Elements 11.  I am sure the solution is quite simple.  When I want to adjust my JPEG height to 900 pixels,for example, I go the the "Document Size."  I can type in 900, but the options are only in inches, percent, cm, mm, points, picas and columns, NOT in pixels.  On the top, it reads, "Pixel Dimensions," but I do not see any way to adjust the dimensions in that spot.  Is there a way to do this?  I run into this problem every time I go to adjust the size of a JPEG, and eventually have to ask a friend to adjust them for me.  Please advise me on this!  Thank you so much, Adrian

    Image >> Resize >> Image Size
    You need to put a checkmark in the resample box and then you can adjust pixel dimensions.

Maybe you are looking for

  • How can I email my iPhone backup from one computer to another?  And then how do I restore my iPhone to this backup once it's on the new computer?

    I updated my iPhone onto my friend's MacBook, but then I lost that iPhone.  When I plugged in a different iPhone to his computer, it did ask me if I wanted to restore it as my old phone, so I must have backed up at least some of the data to his iTune

  • Unable to install weblogic 6.0

    hi, I am unable to install weblogic6.0 on sunos 5.6, sparc platform, below is the message. could somebody throw some light on how to proceed. Arun. # sh weblogic600_sol.bin Preparing to install... Error: failed /tmp/install.dir.24974/Solaris/resource

  • Array_key_exists('cancel', $POST)

    Good evening all, I'm trying to work thru the David Powers book "The essential guide to Dreamweaver CS4"  In chapter 14 he's explaining how to create a form to delete records using the delete record server behavior.  I've created the form several tim

  • [Solved] Font problem when trying to start qmon (sun grid engine)

    When I tried to start the qmon (queue monitor program), the error message show up as below: [root@sge01 ~]# qmon Warning: Cannot convert string "-adobe-helvetica-medium-r-*--14-*-*-*-p-*-*-*" to type FontStruct Warning: Cannot convert string "-adobe-

  • Authorization in BI7

    Hello, how can I restrict the users to execute querries in just one single Infoarea in BI 7.0 (on all infocubes independet of any infoobject) by using the new Analysis Authorizations in transaction: RSECADMIN or do I still need to maintain Standard A