public class Result extends ArrayList<Result>
Modifier and Type | Class and Description |
---|---|
static class |
Result.Datatype
Core datatypes for a result.
|
modCount
Constructor and Description |
---|
Result() |
Result(Boolean valueBoolean)
Builds a boolean result with a result date of today
|
Result(Concept valueCoded)
Builds a coded result with a result date of today
|
Result(Date valueDatetime)
Builds a datetime result with a result date of today
|
Result(Date resultDate,
Boolean valueBoolean,
Object obj)
Builds a boolean result with a specific result date
|
Result(Date resultDate,
Concept valueCoded,
Object obj)
Builds a coded result with a specific result date
|
Result(Date resultDate,
Date valueDatetime,
Object obj)
Builds a datetime result with a specific result date
|
Result(Date resultDate,
Double valueNumeric,
Object obj)
Builds a numeric result with a specific result date
|
Result(Date resultDate,
Integer valueNumeric,
Object obj)
Builds a numeric result with a specific result date
|
Result(Date resultDate,
Result.Datatype datatype,
Boolean valueBoolean,
Concept valueCoded,
Date valueDatetime,
Double valueNumeric,
String valueText,
Object object)
Builds a result date with specific (overloaded) values — i.e., instead of simply
accepting the default translation of one datatype into another (e.g., a date translated
automatically into string format), this contructor allows the various datatype
representations of the result to be individually controlled.
|
Result(Date resultDate,
String valueText,
Object obj)
Builds a text result with a specific result date
|
Result(Double valueNumeric)
Builds a numeric result with a result date of today
|
Result(Integer valueNumeric)
Builds a numeric result with a result date of today
|
Result(List<Result> list)
Builds a result from a list of results
|
Result(Obs obs)
Builds a coded result from an observation
|
Result(Result result)
Builds result upon another result — the first step in create a result that contains a
list of other results.
|
Result(String valueText)
Builds a text result with a result date of today
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Concept concept) |
boolean |
contains(Result result) |
boolean |
containsConcept(Integer conceptId) |
Result |
earliest() |
static Result |
emptyResult() |
boolean |
equals(Object obj) |
boolean |
exists() |
Result |
get(int index) |
Result.Datatype |
getDatatype()
Returns the datatype of the result.
|
Date |
getResultDate()
Returns the data of the result (not to be confused with a data value).
|
Object |
getResultObject()
Get the result object
|
Result |
gt(Integer value) |
boolean |
isNull() |
Result |
latest() |
static Result |
nullResult()
Deprecated.
|
void |
setDatatype(Result.Datatype datatype)
Changes the default datatype of the result
|
void |
setResultDate(Date resultDatetime)
Changes the result date time — not to be confused with a value that is a date.
|
void |
setResultObject(Object object)
Set the result object
|
void |
setValueBoolean(Boolean valueBoolean)
Overrides the boolean representation of ths result without changing the default datatype
|
void |
setValueCoded(Concept valueCoded)
Overrides the coded representation of ths result without changing the default datatype
|
void |
setValueDatetime(Date valueDatetime)
Overrides the datetime representation of ths result without changing the default datatype
|
void |
setValueNumeric(Double valueNumeric)
Overrides the numeric representation of ths result without changing the default datatype
|
void |
setValueNumeric(Integer valueNumeric)
Overrides the numeric representation of ths result without changing the default datatype
|
void |
setValueText(String valueText)
Overrides the text representation of ths result without changing the default datatype
|
Boolean |
toBoolean() |
Concept |
toConcept() |
Date |
toDatetime() |
Double |
toNumber() |
Object |
toObject() |
String |
toString() |
Result |
unique() |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
hashCode
containsAll
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, hashCode
parallelStream, stream
public Result()
public Result(Result result)
result
- the result that will be the sole member of the new resultpublic Result(List<Result> list)
list
- a list of resultspublic Result(Boolean valueBoolean)
valueBoolean
- public Result(Date resultDate, Boolean valueBoolean, Object obj)
resultDate
- valueBoolean
- public Result(Concept valueCoded)
valueCoded
- public Result(Date resultDate, Concept valueCoded, Object obj)
resultDate
- valueCoded
- public Result(Obs obs)
obs
- public Result(Date valueDatetime)
valueDatetime
- public Result(Date resultDate, Date valueDatetime, Object obj)
resultDate
- valueDatetime
- public Result(Double valueNumeric)
valueNumeric
- public Result(Date resultDate, Double valueNumeric, Object obj)
resultDate
- valueNumeric
- public Result(Integer valueNumeric)
valueNumeric
- public Result(Date resultDate, Integer valueNumeric, Object obj)
resultDate
- valueNumeric
- public Result(String valueText)
valueText
- public Result(Date resultDate, String valueText, Object obj)
resultDate
- valueText
- public Result(Date resultDate, Result.Datatype datatype, Boolean valueBoolean, Concept valueCoded, Date valueDatetime, Double valueNumeric, String valueText, Object object)
Result result = new Result(new Date(), 2.5); assertEqualtes("2.5", result.toString()); Result result = new Result(new Date(), Result.Datatype.NUMERIC, 2.5, null, null, "Two and a half", null); assertEquals("Two and a half", result.toString());
resultDate
- datatype
- valueBoolean
- valueCoded
- valueDatetime
- valueNumeric
- valueText
- object
- @Deprecated public static final Result nullResult()
public static final Result emptyResult()
public Result.Datatype getDatatype()
public void setResultDate(Date resultDatetime)
resultDatetime
- public void setDatatype(Result.Datatype datatype)
datatype
- public void setValueBoolean(Boolean valueBoolean)
valueBoolean
- public void setValueCoded(Concept valueCoded)
valueCoded
- public void setValueDatetime(Date valueDatetime)
valueDatetime
- public void setValueNumeric(Integer valueNumeric)
valueNumeric
- public void setValueNumeric(Double valueNumeric)
valueNumeric
- public void setValueText(String valueText)
valueText
- public Date getResultDate()
toDatetime()
public Object getResultObject()
public void setResultObject(Object object)
object
- public Boolean toBoolean()
Datatype | Returns |
CODED | false for concept FALSE true for all others |
DATETIME | true for any date value false if the date is null |
NUMERIC | true for any non-zero number false for zero |
TEXT | true for any non-blank value false if blank or null |
public Concept toConcept()
public Date toDatetime()
Datatype | Returns |
BOOLEAN | null |
CODED | null |
NUMERIC | null |
TEXT | If the text can be parsed into a date, then that value is returned; otherwise returns null |
public Double toNumber()
Datatype | Returns |
BOOLEAN | 1 for true 0 for false |
CODED | zero (0) |
DATETIME | Number of milliseconds since Java's epoch | TEXT | numeric value of text if it can be parsed into a number otherwise zero (0) |
public String toString()
toString
in class AbstractCollection<Result>
public Object toObject()
public boolean isNull()
public boolean exists()
public boolean contains(Concept concept)
public boolean containsConcept(Integer conceptId)
public boolean contains(Result result)
public Result unique()
public boolean equals(Object obj)
equals
in interface Collection<Result>
equals
in interface List<Result>
equals
in class AbstractList<Result>
Object.equals(java.lang.Object)
public Result get(int index)
get
in interface List<Result>
get
in class ArrayList<Result>
List.get(int)
public Result earliest()
public Result latest()
Copyright © 2018 OpenMRS LLC.. All Rights Reserved.