Package repast.simphony.util.collections
Class SimpleWrapper<T>
- java.lang.Object
-
- repast.simphony.util.collections.Pair<String,T>
-
- repast.simphony.util.collections.SimpleWrapper<T>
-
public class SimpleWrapper<T> extends Pair<String,T>
A simple wrapper class that will hold an object and for itstoString()
will return a given description. This stores the description as the super's first, and the object as the super's second.- Author:
- Jerry Vos
-
-
Constructor Summary
Constructors Constructor Description SimpleWrapper(String description, T wrappedObject)
Constructs this with the specified description and wrapped object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getWrappedObject()
Same asPair.getSecond()
.String
toString()
Same asPair.getFirst()
.
-
-
-
Constructor Detail
-
SimpleWrapper
public SimpleWrapper(String description, T wrappedObject)
Constructs this with the specified description and wrapped object. This calls on the superPair#Pair(X, Y)
with the first argument as the description and the second as the wrapped object.- Parameters:
description
- the description of the wrapped objectwrappedObject
- the wrapped object
-
-
Method Detail
-
toString
public String toString()
Same asPair.getFirst()
.
-
getWrappedObject
public T getWrappedObject()
Same asPair.getSecond()
.
-
-