Problem It’s somewhat odd that Java’s collection framework has no iterator for recursive data structures. Since I needed something like […]
Tag: casting
Testing whether an abstract object is an instance of one of the several concrete classes
Problem I have an abstract object and I need to test whether it is an instance of one of the […]
Multiple explicit cast operations
Problem This sample code works fine, but it looks awful. How would you improve this? data.Add(((Adress)(((OwnerIDList)owner.Adresses.Value)[0].Adress.Value)).FirstName.Value.ToString()); data.Add(((Adress)(((OwnerIDList)owner.Adresses.Value)[0].Adress.Value)).LastName.Value.ToString()); Why do we […]
Alternative to using Object and casting in a map
Problem I have the following class which represents a set of properties. public class Properties { /** String type properties. […]
Limited typecasting with regex
Problem I’m learning Python, and found a fun little video on YouTube called “Learn Python through public data hacking”. In […]
Workaround for unchecked cast of a deserialized Object to ArrayList
Problem For a class I was assigned to write code to read objects of the class Vehicle using ObjectInputStream (in). […]
Writing a generic casting extension-method
Problem I’m writing a C# extension-method that converts any object to a type. E.g. the method shall convert a string […]
Loops for removing unnecessary lines
Problem I have the following method: private void removeUnnecessaryLines(List<ScatterViewItem> list) { List<Line> remove = new List<Line>(); foreach (Line line in […]
Here’s my interface, so call me …maybe
Problem I’m inspecting VBA code to find obsolete code constructs – namely explicit Call statements, like this: Call DoSomething(42) The […]
Nice way to using cast on TextView [closed]
Problem Closed. This question is off-topic. It is not currently accepting answers. This question does not appear to be a […]