KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > Pair


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.debug.internal.ui;
12
13 /**
14  * Pair is a basic tuple of two with classic first and second members.
15  * Since Java is non-polymorphic, we use Object(s) for the pair elements
16  * and cast our brains out.
17  */

18 public class Pair {
19     public Object JavaDoc fFirst = null;
20     public Object JavaDoc fSecond = null;
21     public Pair(Object JavaDoc first, Object JavaDoc second) {
22         fFirst = first;
23         fSecond = second;
24     }
25     /*
26      * String accessors
27      */

28     public String JavaDoc firstAsString() {
29         return (String JavaDoc) fFirst;
30     }
31     public String JavaDoc secondAsString() {
32         return (String JavaDoc) fSecond;
33     }
34 }
35
Popular Tags