Child pages
  • Common Java to .NET type conversion
Skip to end of metadata
Go to start of metadata

Helpful References

Java Class
........................................

C# Version
.............................................

Lucene.Net Only

Notes

Entry<K,V>

KeyValuePair<TKey,TValue>

 

 

HashMap<K,V>

Dictionary<TKey,TValue>

 

 

Class<? extends Type>

Type

 

There is no direct equivalent in .net for this. You'll have to manually check for type information. In some cases, generally as method type parameters, you can enforce compile time checking, like MyMethod<T>(T thing) where T : IMyConstraint

ICloseable

IDisposable

 

This comparison is for when the class needs to release resources. When an object
is disposed it would be best to throw ObjectDisposedExceptions.

ICloseable

ICloseable

X

* Lucene.Net.Support This should only be used for file operations or things that needs to be closed
that could be reopened

WeakHashMap<K,V>

WeakDictionary<TKey,TValue>

X

*  Lucene.Net.Support. There are some
differences between how the two work. The C# version has WeakReference<T>
to both the key and value. As far as I know its only the key in the java version.

WeakReference<T>

WeakReference<T>

X

*  Lucene.Net.Support. There is a WeakReference<T> in silverlight 5. Thus
a generic version of WeakReference was created for Lucene.Net

 

 

 

 

 

 

 

 

  • No labels