diff src/org/tmatesoft/hg/internal/Pool.java @ 431:12f668401613

FIXMEs: awkward API refactored, what need to be internal got hidden; public aspects got captured in slim interfaces
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 29 Mar 2012 20:54:04 +0200
parents 6bb5e7ed051a
children
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/Pool.java	Thu Mar 29 18:48:23 2012 +0200
+++ b/src/org/tmatesoft/hg/internal/Pool.java	Thu Mar 29 20:54:04 2012 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 TMate Software Ltd
+ * Copyright (c) 2011-2012 TMate Software Ltd
  *  
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,13 +18,15 @@
 
 import java.util.HashMap;
 
+import org.tmatesoft.hg.util.Convertor;
+
 /**
  * Instance pooling.
  * 
  * @author Artem Tikhomirov
  * @author TMate Software Ltd.
  */
-public class Pool<T> {
+public class Pool<T> implements Convertor<T> {
 	private final HashMap<T,T> unify;
 	
 	public Pool() {
@@ -38,7 +40,11 @@
 			unify = new HashMap<T, T>(sizeHint * 4 / 3, 0.75f);
 		}
 	}
-	
+
+	public T mangle(T t) {
+		return unify(t);
+	}
+
 	public T unify(T t) {
 		T rv = unify.get(t);
 		if (rv == null) {