View Javadoc

1   package com.eviware.soapui.support.types;
2   
3   import java.util.ArrayList;
4   import java.util.Collection;
5   
6   public class TupleList<T1 extends Object, T2 extends Object> extends ArrayList<TupleList.Tuple>
7   {
8   	public TupleList()
9   	{
10  	}
11  
12  	public TupleList( Collection<? extends Tuple> c )
13  	{
14  		super( c );
15  	}
16  
17  	public TupleList( int initialCapacity )
18  	{
19  		super( initialCapacity );
20  	}
21  
22  	public void add( T1 value1, T2 value2 )
23  	{
24  		add( new Tuple( value1, value2 ) );
25  	}
26  
27  	public class Tuple
28  	{
29  		private T1 value1;
30  		private T2 value2;
31  
32  		public Tuple( T1 value1, T2 value2 )
33  		{
34  			this.value1 = value1;
35  			this.value2 = value2;
36  		}
37  
38  		public T1 getValue1()
39  		{
40  			return value1;
41  		}
42  
43  		public void setValue1( T1 value1 )
44  		{
45  			this.value1 = value1;
46  		}
47  
48  		public T2 getValue2()
49  		{
50  			return value2;
51  		}
52  
53  		public void setValue2( T2 value2 )
54  		{
55  			this.value2 = value2;
56  		}
57  
58  		public String toString()
59  		{
60  			return TupleList.this == null ? value1 + " : " + value2 : TupleList.this.toStringHandler( this );
61  		}
62  	}
63  
64  	protected String toStringHandler( Tuple tuple )
65  	{
66  		return tuple.value1 + " : " + tuple.value2;
67  	}
68  }