Advice on how to make this look up?

Hello everyone.
I was wondering if anyone can give me advice on how to do this to make it the last complex.
I thought up some complex solutions that will work but seem messy in some ways.
I need to create a look up, I'm parsing a file and transforming it based on its field name and field value. If a certain field name and field value is found, I need to create specific subfields. An example is:
say I read in a file and I come across
A class named interface
with a data field DisplayStatus and field type: INTEGER INIT(132)
DisplayStatus INTEGER INIT(132)
Then I need to create a file that looks like this:
DisplayStatus INTEGER INIT(132);
OP 'interface'.'DisplayStatus'
HAS_SUBFIELD NOTIFY;
OP 'interface'.'DisplayStatus'
HAS_SUBFIELD TIMESTAMP;
OP 'interface'.'DisplayStatus'
HAS_SUBFIELD CHANGE;
OP 'interface'..'DisplayStatus'.CHANGE
SUBFIELD_HAS_VALUE (METHODSPEC) (DUIFCRDC) ;
OP 'interface'.'DisplayStatus'
On the other hand, if I run across a field name:
CommandIndicator CHARVAR;
Then I need to create the following in a file:
CommandIndicator CHARVAR;
OP 'interface'.'CommandIndicator'
HAS_SUBFIELD NOTIFY;
So you can see, based on a specific field name, and data type, they have unique data types.
My solution was going to store a text file that contained all the field names, data types and subfields, and just create a map, so based on the field name, it will look up the value which wil be the subfields, but you can see the sub fields can either be 1 line long, or it can be multiple lines long, thats where I'm running into issues.
What type of data structure would I use? a Map<String, List<String>> ? or is that making it more complicated than it ahs to be?

To make sure I understood you correctly:
You have a file like
class classname
fieldname1 DATATYPE1 constraint
fieldname2 DATATYPE2 constraintyou want
OP 'classname'.'fieldname1'.some optional string
some line defined by DATATYPE1
...How would you store "some optional string" in a Map<String, List<String>>?
Do you just replace a special char sequence with 'interface'..'DisplayStatus'?
If so, why not just store the lines in one String including the line breaks, making the list dispensable?
Regarding XML:
I guess he meant that if you had both your source files in xml, you could do what you want via XSL transformation.
But you'll have to google for that yourself. It has been a while since I worked with that.

Similar Messages

  • Need some advice on how to make this Flash movie

    I have 5 flash movies which are all exported swf files from Camtasia. Now I have to design a Flash movie which has 5 Icons on a blank screen which point to each of these movies. When the user clicks on one movie the exported swf from Camtasia should play and when its finished it shoudl go back to Main Menu page.
    a) Is it possible to include a controllable progress bar for a SWF movie
    I am just looking for advice , like do this and do that. I shall try and write the code myself.
    cheers
    peanutlife.

    You may find the VideoPlayer class helpful:
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/video/VideoPlayer.html#includ eExamplesSummary
    There's some sample code there which shows you how to put a video player on a movie and play something.  You would just need to add some buttons and stuff.  That example is Actionscript 3.  Things will be different if you have an older version of Flash.

  • Need advice on how to make this all work together

    Not really sure where to post this, so I decided to post here.  I'm trying to streamline devices and move more into the cloud.  Because of some weird network issues it is complicated.  
    Currently I have a MacMini at home.  I am a teacher so office-type documents are important.  I'm currently using Mac Office 2011.  I have a netbook that I use to show PowerPoint at school and to have access to documents.  I use Dropbox to keep them in sync.  I also have an iPhone 4 and 3rd gen iPad with unlimited 3G/4G data.
    The big fly in the ointment is that Dropbox is blocked on our school network.  This causes all kinds of problems because it means I have to sync my netbook in the mornings and afternoons or I get conflicts.  Its also a pain to get things off the net.  I have to use my school PC, then USB it to my netbook because it has no net access. 
    I also want to keep school and personal items completely separate. 
    Things I have been considering....
    Moving to iWork apps to make use of Apple's cloud.
    Replacing my mini with a MBP to use as a base at home, and to then be able to take to school.  I would not want to use it on my projector so that's an issue.
    Using an iPod Touch to show keynote presentations.
    Laptop thoughts usually creep in, but to be honest I've never really used them all that often.  I like lots of screen room. 
    I would prefer the iPad to be my main mobile computer.
    Looking forward to any input.

    I have a MBP, IPAD with retina display, and multiple iphones in the family. I have a Airport Extreme for my router and Apple TV hooked up to our lcd TV. The Apple TV is great because you can use any apple device to project whatever your working with onto the Apple TV with Airplay. Not sure if you would be able to connect your Apple TV to the school network, but if you could that would be the answer along with using the cloud. The key would be access to the school network.

  • I just got the new Ipad. When I try to send a message to my friends Iphone the blue send icon wont work.  Anybody have any advice on how to make this work.

    The blue icon is there, its just isnt bolded and doesnt do anything when i press it.  Please help!

    First, try a Reset [Hold the Home and Sleep/Wake buttons down together for 10 seconds or so (until the Apple logo appears) and then release. When the screen goes blank then power ON again in the normal way.] It is 'appsolutely' safe!
    Then, see here http://support.apple.com/kb/HT3529

  • Bridge: How to make PDF looking like this:

    I try to arrange my images in PDF document, which I'm making in Adobe Bridge CS5.
    I want to make this looking something like this:
    How to make it?

    Or get a decent program like Contact Sheet X.
    http://csx.riaforge.org/

  • I am trying to connect my Sony DCR-TRV350 to iMovie so that I can make DVD's from family videos.  I am having problems getting the video camera connected.  Any advice on how to do this?

    I am trying to connect my Sony DCR-TRV350 to iMovie so that I can make DVD's from family videos.  I am having problems getting the video camera connected.  Any advice on how to do this?

    What happens when, after you connect your cam, you go to File > Import Media?
    But before that, does your cam require you to export your video files upon USB connection? I have a JVC Everio HD and I have to "Export to Library" from the cam's menu first-thing. This was true even in prior iMovie versions.

  • How to make this pattern?

    Hello guys Please I am looking for advice how to make this kind of pattenr in pohtoshop- you can see it on background- the rounded one- en the end whole piece makes nice surface.
    http://vladstudio.deviantart.com/art/Typographic-World-Map-106395788
    thank a lot

    Sometimes a patten is defined for some pixel size and may even need to have the document rotated to have the proper orientation for the pattern. For example a frame pattern for a one inch wide strip.  An Action can be created to add the pattern to a mitered 1" wide strip at 300 dpi  on the left side then rotate the document for the other side rotate back and dupe and flip the frame side added.
    If you search the web there are a countless number of patterns that can be downloaded for free textures like woods ,paper, textiles etc.

  • Something keeps trying to download on my mac and I don't know what it is. It is not in the apple store and just comes out nowhere and request for my password to download something and I don't know what it is. How to make this stop?

    Something keeps trying to download on my mac and I don't know what it is. It is not in the apple store and just comes out nowhere and request for my password to download something and I don't know what it is. How to make this stop? It pops up every single day.

    Erica,
         I can, with 99.99% certainty, tell you that you are absolutely right in not wanting to download or install this "Helper," whatever it is (but we can be equally certain it would not "help" anything).
         I cannot comment as to Oglethorpe's recommendation of 'adwaremedic'; I am unfamiliar with it.  His links to the Apple discussion and support pages warrant your time and attention.
         It might be really simple -- Trying looking in your Downloads folder, trash anything that you don't know with certainty is something you want to keep, and then Secure Empty your Trash. Then remove the AdBlock extension, LastPass, and Web of Trust extensions to Safari and re-boot. If the issue goes away, still be extraordinarily careful in the future.
         Unfortunately, it's probably not going to be that simple to get rid of, in which case I'd then try the line by line editing in HT203987. 
         I have no further suggestions (other than a complete wipe and re-install...but that's a pain because trying to restore from Time Machine would simply ... restore the Mal).
       For the rest of us, please post when you find a solution.
         Best.
         BPW
      (Also, try to edit your second post -- black out your last name on the screenshot and re-post it for others)

  • How to make this in Adobe Photoshop CS5? PLEASE Help!

    Hey guys, i reallllllllly  want to know how to make this image in adobe photoshop.... the cone around the forecast track. Can you guys please show me how to do this? Id greatly appreciate it!

    There's a lot implied here, but you're not going to get around having to do the following in general:
    Use an unmarked map as a background.
    Draw shapes on layer(s) above the background and make them partially transparent.
    Obviously the key is to draw shapes that express the "cone of uncertainty" exactly as you want it to look, and with a minimum of fuss.
    I'd suggest drawing shapes with Path tools, then filling the shapes, applying a stroke (for the edge border), and using masking to hide parts you don't want to show (or which overlap with the other parts you're drawing).
    Are you needing to do this over and over or just once?
    -Noel

  • How to make website look correct in Safari, Firefox, and Chrome?

    Hello there. I'm working on a website which was inherited to me by someone who died. So I am left with all of his coding which is about 4 years old. Now I'm working on positioning of the website and i've found that the only browser the website looks like it's supposed to is Safari and I can't for the life of me figure out how to make it look right in all the browsers and on a phone or tablet. It might be easier if I started from scratch but unfortunately I don't get that luxury. Please help me.
    Here's a link...MuseumOfNaturalistory.com

    I dont understand what some of these errors are asking of me. For instance, this one...
    if (xmlhttp.readyState==4 && xmlhttp.status==200)

    This message may appear in several cases:
    You tried to include the "<" character in your page: you should escape it as "&lt;"
    You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&amp;", which is always safe.
    Another possibility is that you forgot to close quotes in a previous tag.
    That's the way the code has to be in order to function. What does it want from me?
    And then here....
    Line 71, Column 5: an attribute value must be a literal unless it contains only name characters   </div>✉You have used a character that is not considered a "name character" in an attribute value. Which characters are considered "name characters" varies between the different document types, but a good rule of thumb is that unless the value contains only lower or upper case letters in the range a-z you must put quotation marks around the value. In fact, unless you have extreme file size requirements it is a very very good idea to always put quote marks around your attribute values. It is never wrong to do so, and very often it is absolutely necessary.
    Line 71, Column 5: character "<" is not allowed in the value of attribute "id"   </div>✉It is possible that you violated the naming convention for this attribute. For example, id and name attributes must begin with a letter, not a digit.
    I have absolutely no clue what it is asking of me. Doesn't it have to be that way? Also why when I go to "Line 71" that isn't where this actual code is? Is there some special way to decipher this?

  • How to make this animation in TwitchPlugin?

    Hi, I have question, how to make this effect and animation in twitch.
    Effect:
    Animation:
    http://youtu.be/UIrSSYjW5-A?t=15s

    If you bought the plug-in you have a bunch of tutorials.
    If you are thinking about buying the plug-in take a look at the tutorials provided by Video CoPilot
    https://www.videocopilot.net/products/twitch/
    If you are still lost AE Basics

  • How to make this logo effect? Help please!

    How to make this effect? I'm new in illustrator.

    It looks like 3 discs with a 2d image applied to them. I would try the 3d revolve tool to create one, then duplicate it for the other two.

  • How to make this in Flash Builder?

    I am looking to make an Android app and one of the functionalities is somehting like in the video.
    I am new to Flash Builder and looking for some help to make it.
    Anyone has a tutrial or has any idea how to make this?
    Android SQLite App Development with Flash Builder and Flex - YouTube

    I'll give you the short answer, Flash Catalyst is built on top of the Flex Framework and it's libraries. When you launch or load a FC swf, it will contact the Adobe servers to check the status of various libraries. Since you are loading this into a standard Flash Professional created swf, you are by passing some of the fallbacks that exist.
    If the movieClip that you are creating is just a filler image, and you are just centering the FC swf, then I also recommend using CSS to display the filler and some HTML/CSS to center the content.
    Hope this helps a little.
    If you did the loading of the FC swf from a Flash Builder based project, you should not have the issue, since it is a Flex based SWF, the framework checks are already handled for you.
    Chris

  • How to make HD look like 4K

    I found this article rather interesting. If I had to try and make a silk purse out of a sow's ear, I would read this one again.
    RedShark News - How to make HD look like 4K

    I'd forgotten about RedShark in general ... thanks for the heads-up.
    And the point about the "impression" being at times more important than the reality (especially if not well handled) is well taken. Working professional stills for many years now ... I've had large prints that even at close inspection looked much cleaner, sharper, and less noisy than other photog's made who had "larger" sensors ... but did their post not as righteously as I did. How you set up & shoot the image/s in the first place matters ... as does how you handle your post & output.
    Craft matters ...  

  • When I try to order a book in iPhoto it says I have empty frames on pages. But I don't. Any advice on how to correct this so I can order this book? Thanks.

    When I try to order a book in iPhoto it says I have empty frames on pages. But I don't. Any advice on how to correct this so I can order this book? Thanks.

    You do have one or more empty photo frames. Most often it will be a full page photo page missing behind a placed full page photo. To find it you need to go through you'd book and look behind each full page photo
    LN

Maybe you are looking for

  • How can I remove Apple ID from my old Iphone? I want to sell it.

    I want to sell my Iphone, how do I need to remove my Apple Id from there. The one why buys needs to create a new Apple ID. Can I use my old Apple ID when I have a new Iphone? Thanks!

  • Create a template app?

    Whenever I start a new project in Flex builder I always have to go and add all my project build paths, adjust the compiler settings, etc. Is there a way I can make a template with all that done and then just click new from template? Thanks.

  • Can i send table_name and field_name as function arguments.

    hi, i need to get the maximum column value for a field in the required table at run time. i need to send the table name as a parameter to the function. my code is, create or replace function (tname in varchar2, fldname in varchar2) is val number, beg

  • Calling print program from co03

    hi all, we have a requirement to print the production order through smartforms . the process is like...if we click on  functions--->print ..then a print program is called..which fetches the production order number from in co03...and then the print pr

  • IMessages delivered despite not delivered error on Mountain Lion?

    Since I upgraded my MBP to mountain lion this past week and set it up to receive my imessages on the desktop, all iPhone 4s imessages are showing an error. Once I send an imessage on my phone, it says delivered and then quickly changes to "Not Delive