Class Reference<T>
java.lang.Object
org.parboiled.common.Reference<T>
- Type Parameters:
T-
- Direct Known Subclasses:
Var
A simple container holding a reference to another object.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanclear()Sets this references value field to null.get()Retrieves this references value object.Retrieves this references value field and clears it.Replaces this references value with the given one.booleanisNotSet()booleanisSet()booleanSets this references value object to the given instance.Replaces this references value with the given one.
-
Constructor Details
-
Reference
public Reference()Create a new Reference with a null value. -
Reference
Create a new Reference to the given value object.- Parameters:
value- the value object
-
-
Method Details
-
clear
public boolean clear()Sets this references value field to null.- Returns:
- true
-
set
Sets this references value object to the given instance.- Parameters:
value- the value- Returns:
- true
-
get
-
getAndClear
Retrieves this references value field and clears it. Equivalent to getAndSet(null).- Returns:
- the target
-
getAndSet
-
setAndGet
-
isSet
public boolean isSet()- Returns:
- true if this Reference holds a non-null value
-
isNotSet
public boolean isNotSet()- Returns:
- true if this Reference holds a null value
-