public abstract class AbstractContext
extends java.lang.Object
implements java.io.Serializable
AbstractContext
is a generic context class. It has two fields: name and userObject. The name is just the
name of the context. You can use a meaningful string to name it. The userObject is customizable portion of Context.
You can set whatever you want as userObject. It's just a convention between whoever set it and whoever use it. For
example, in ConverterContext
, we sometimes used it to pass in a Format
.Constructor and Description |
---|
AbstractContext(java.lang.String name)
Creates a named
AbstractContext . |
AbstractContext(java.lang.String name,
java.lang.Object object)
Creates an abstract context with a name and an object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Override equals.
|
java.lang.String |
getName()
Gets the name of the abstract context.
|
java.lang.Object |
getUserObject()
Gets the user object.
|
int |
hashCode() |
void |
setName(java.lang.String name)
Sets the name of the abstract context.
|
void |
setUserObject(java.lang.Object userObject)
Sets the user object.
|
java.lang.String |
toString() |
public AbstractContext(java.lang.String name)
AbstractContext
.name
- the name of the AbstractContext
.public AbstractContext(java.lang.String name, java.lang.Object object)
name
- the name of the AbstractContext
.object
- the user object. It can be used any object to pass information along.public java.lang.String getName()
public void setName(java.lang.String name)
name
- the name of the abstract contextpublic java.lang.Object getUserObject()
public void setUserObject(java.lang.Object userObject)
userObject
- the user object.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- object to compare.public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object