We have an ArrayList elements in several classes that bring me problems every time I would like to insert a new element into the list. For my part, it was a mistake to design the classes as I did, but changing the design will now be more of a headache than worth it (bureaucratic model of the waterfall). I had to anticipate the format changes in the documents that the client supplied us with the waterfall to be damned.
I would like to write a simple python script that goes into the class, adds an item to the list, and then increments all the search results for the following elements. This is not very revealing:
Foo extends Bar{ public Foo(){ m_Tags.add("Jane"); m_Tags.add("Bob"); m_Tags.add("Jim"); } public String GetJane() { return m_ParsedValue.get( m_Tags.get(1) ); } public String GetBob() { return m_ParsedValue.get( m_Tags.get(2) ); } public String GetJim() { return m_ParsedValue.get( m_Tags.get(3) ); } }
You see, if I want to add a value between "Jane" and "Bob", then I need to increase the number of integers in the Get * functions. I just want to write a simple script in Python that does this work for me. Someone whom I respect a lot was offering a regular expression.
Edit:
Yes, LinkedHashMap. So simple, so simple and so not in design now. I hate the waterfall. I hate this with passion. This whole bit was the "small" and "easy" part, which "should not spend a lot of time on development." I made mistakes. Now he is stuck in stone.
java python regex perl
wheaties
source share