Java: general function X->Y interface
Hi, I need an interface like: interface Function<X,Y> { Y eval(X obj); } Is there something like this in Java already or do I need to define my own? ...
Hi, I need an interface like: interface Function<X,Y> { Y eval(X obj); } Is there something like this in Java already or do I need to define my own? ...
I'm looking for a tool for .NET libraries that: given: a 3rd party library with only concrete implementations of classes produces: extracts an interface from the 3rd party library and creates an adapter to the concrete implementation I have some pretty big 3rd party tools... doing it by hand looks like a pain. I'm hoping to be able t...
Hi all, I have a existing xib file, it's a simple uiviewcontroller, but now I want a put a navigation controller in this xib file, because this view is modal, so the navigation controller in the mainWindow don't work. So, if I put a navigationController in my xib file, what is the view that I must link with the file owners..? ...
I'm really confused. // initial class type TTestClass = class( TInterfacedObject) end; {...} // test procedure procedure testMF(); var c1, c2 : TTestClass; begin c1 := TTestClass.Create(); // create, addref c2 := c1; // addref c1 := nil; // refcount - 1 MessageBox( 0, pchar( inttostr( c2.refcount...
What I mean, interface B; interface A extends B; allowed interface A implements B; not allowed I googled it and I found this -> Implements denotes defining an implementation for the methods of an interface. However interfaces have no implementation so that's not possible. http://www.coderanch.com/t/410331/java/java/interface-imple...
I'm currently developing a solution and have designed it in a way such that it strongly implements the strategy/provider pattern. As such the solution exposes a number of interfaces and contains default implementations of these interfaces which can be replaced via a DI type methodology. Where the host application uses a number of these...
Well till now I knew we implement interfaces , but today some body (you know who , i guess)) told me that If I write a interface then we implement it in class , but if it is a system Interface , Let's say INotifyPropertyChanged , the we call it Class A inherits Interface INotifyPropertyChanged. Though I feel right , I am not sure and un...
I'm trying to figure out if it would be possible to stick to the mantra "Program against an interface, not an implementation." while using the Entity Framework 4.0. While I found a page explaining how to stick to aforementioned rule while using Linq-to-SQL (look here) I'm very keen to know if it would be possible to do that with the Ent...
Considering the following setup, how can I restrain IConnection to only contain IPort of the same ConnectionType in Ports? Maybe I am overlooking something obvious here: Enum ConnectionType { Undefined, Type1, Type2 } IConnection { ConnectionType ConnectionType {get;set} IEnumerable<IPort> Ports {get;set;} } IPort...
I am trying to create a site that has option to add maps to the site using google maps api. I found hundreds of tutorial and blog posts on embeding map in the site. But what I actually want is a way to give the user choose a place on the map and add marker. Then get the co-ordinates of the marker and store it in the database of retrievin...
I'm quite new to C#, and have two questions regarding generic lists and extension methods. Sorry if the questions are a bit stupid.. What is the difference between: public static IObjectWithTempID FindByTempID (this ObservableCollection<IObjectWithTempID > list, long tempID) and public static IObjectWithTempID FindByTempID< E ...
Hey there, I'm fairly new to Java, and I need some help figuring out a good class hierarchy and overall design for an assignment we've been given (i'm studying CS). The assignment is graph-theory related, so we were asked to create interfaces for 2 types of graphs, simple graphs and multi-graphs (which are allowed to have parallel edge...
I have got a abstract class which is implementing 3 interfaces. public abstract class ServiceBaseCore<Entity, EntityKey> : MarshalByRefObject, IComponentService, IEntityProvider<Entity, EntityKey> where Entity : IEntityId<EntityKey>, new() where EntityKey : IEntityKey, new() { // Provided functionality/body to some methods of...
Hi, What is the difference between a private method and a private interface? For example, I know that if you define a method in an implementation and its interface does not mention it, it is considered a private method. I have also seen things such as: @interface Collector() @property (readonly) NSMutableDictionary *count; @end Insid...
Hi! I need to know the path of a file in which an interface is defined. I know the name and the interface is available (the file was included at another location in the code). I know things like __FILE__, etc. but the point is, it's only an interface, i do not have an instance. Ironically, i need the path to find a suitable implementati...
I have a DataTemplate that needs to set the IsSelected property on an ItemsControl's container (such as TreeViewItem, ListViewItem or ComboBoxItem). However, it doesn't know the type of the container until it's passed in to it. Since IsSelected isn't part of a common base class or interface, nor is it a common dependency property regis...
interface Foo<T extends Number>{ } class Bar<T extends Number> implements Foo<T>{ } Why does the class have to be written that way instead of: class Bar<T extends Number> implements Foo<T extends Number>{ } Surely the second way is clearer. ...
interface Int { public void show(); } public class Test { public static void main(String[] args) { Int t1 = new Int() { public void show() { System.out.println("message"); } }; t1.show(); } } ...
let's have this code : class MyList : IEnumerable, IEnumerator { int[] A = { 1, 2, 3, 4, 5 }; int i = -1; #region IEnumerator Members public object Current { get { return A[i]; } } public bool MoveNext() { i++; return i < 5; } public void Reset() { i = -1; ...
Let's have this code : class student :IComparable , IComparable<student> { public string name = ""; public override string ToString() { return name; } #region IComparable Members public int CompareTo(object obj) { if (this.name.Equals(((student)obj).name ) ) return 0 ; ...