class GXyDataset<X extends Comparable,S extends Comparable> extends Object implements XyDataset<X,S>
This is open source software released under the Apache 2.0 License
| Modifier and Type | Field and Description |
|---|---|
private com.zavtech.morpheus.array.Array<Integer> |
colOrdinals |
private Supplier<Class<X>> |
domainType |
private IntFunction<X> |
domainValueFunction |
private com.zavtech.morpheus.frame.DataFrame<?,S> |
frame |
private Consumer<GXyDataset<X,S>> |
refreshHandler |
| Modifier | Constructor and Description |
|---|---|
private |
GXyDataset(Consumer<GXyDataset<X,S>> refreshHandler)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(JsCode script) |
void |
clear(boolean notify)
Clears all data for this dataset
|
boolean |
contains(S seriesKey)
Returns true if this data contains the series specified
|
private Function<Object,String> |
createDomainFunction(Class<?> dataType)
Creates a function that yields a long time value in epoch millis given some input
|
IntFunction<X> |
domainFunction()
Returns the domain function for this dataset
|
Class<X> |
domainType()
Returns the domain type for this dataset
|
<R> com.zavtech.morpheus.frame.DataFrame<R,S> |
frame()
Returns the current frame for this data, which can be null
|
(package private) Class<X> |
getDomainKeyType()
Returns the class of the domain values in this dataset
|
int |
getDomainSize()
Returns the number of values per series
|
X |
getDomainValue(int item)
Returns the domain value for the item index
|
Iterable<X> |
getDomainValues()
Returns the iterable of domain values for this dataset
|
double |
getRangeValue(int item,
int series)
Returns the range value for the item and series index
|
int |
getSeriesCount()
Returns the number of series in this dataset
|
S |
getSeriesKey(int series)
Returns the series for the index specified
|
Iterable<S> |
getSeriesKeys()
Returns the series keys for this dataset
|
boolean |
isEmpty()
Returns true if this dataset is empty
|
static void |
main(String[] args) |
(package private) static <X extends Comparable,S extends Comparable> |
of(S domainAxisKey,
Supplier<com.zavtech.morpheus.frame.DataFrame<?,S>> frameSupplier)
Returns a newly created model using a frame supplier where the domain is presented by a column in the DataFrame
|
(package private) static <X extends Comparable,S extends Comparable> |
of(Supplier<com.zavtech.morpheus.frame.DataFrame<X,S>> frameSupplier)
Returns a newly created model using a frame supplier where the domain is presented by the DataFrame row keys
|
void |
refresh()
Triggers a refresh of this data based on the bound supplier
|
private void |
update(com.zavtech.morpheus.frame.DataFrame<?,S> frame,
com.zavtech.morpheus.array.Array<Integer> colOrdinals,
Supplier<Class<X>> domainType,
IntFunction<X> domainValueFunction)
Updates this model with the DataFrame, series column ordinals and domain value function
|
XyDataset<X,S> |
withLowerDomainInterval(Function<X,X> lowerIntervalFunction)
Sets the function to supply the lower domain interval value for this dataset
The lower domain interval function accepts a domain key and returns the interval to subtract
|
XyDataset<X,S> |
withUpperDomainInterval(Function<X,X> upperIntervalFunction)
Sets the function to supply the upper domain interval value for this dataset
The upper domain interval function accepts a domain key and returns the interval to subtract
|
private com.zavtech.morpheus.frame.DataFrame<?,S extends Comparable> frame
private com.zavtech.morpheus.array.Array<Integer> colOrdinals
private Supplier<Class<X extends Comparable>> domainType
private IntFunction<X extends Comparable> domainValueFunction
private Consumer<GXyDataset<X extends Comparable,S extends Comparable>> refreshHandler
private GXyDataset(Consumer<GXyDataset<X,S>> refreshHandler)
refreshHandler - the refresh handlerstatic <X extends Comparable,S extends Comparable> GXyDataset<X,S> of(Supplier<com.zavtech.morpheus.frame.DataFrame<X,S>> frameSupplier)
X - the domain key typeS - the series key typeframeSupplier - the DataFrame supplier for this modelstatic <X extends Comparable,S extends Comparable> GXyDataset<X,S> of(S domainAxisKey, Supplier<com.zavtech.morpheus.frame.DataFrame<?,S>> frameSupplier)
X - the domain key typeS - the series key typedomainAxisKey - the DataFrame column key for the domainframeSupplier - the DataFrame supplier for this modelprivate void update(com.zavtech.morpheus.frame.DataFrame<?,S> frame, com.zavtech.morpheus.array.Array<Integer> colOrdinals, Supplier<Class<X>> domainType, IntFunction<X> domainValueFunction)
frame - the DataFrame to acceptcolOrdinals - the series column ordinalsdomainValueFunction - the domain value functionpublic void refresh()
XyDatasetrefresh in interface XyDataset<X extends Comparable,S extends Comparable>public boolean isEmpty()
XyDatasetisEmpty in interface XyDataset<X extends Comparable,S extends Comparable>public void clear(boolean notify)
XyDatasetclear in interface XyDataset<X extends Comparable,S extends Comparable>notify - if true, fire notification eventpublic <R> com.zavtech.morpheus.frame.DataFrame<R,S> frame()
XyDatasetframe in interface XyDataset<X extends Comparable,S extends Comparable>public Class<X> domainType()
XyDatasetdomainType in interface XyDataset<X extends Comparable,S extends Comparable>public boolean contains(S seriesKey)
XyDatasetcontains in interface XyDataset<X extends Comparable,S extends Comparable>seriesKey - the series keypublic IntFunction<X> domainFunction()
XyDatasetdomainFunction in interface XyDataset<X extends Comparable,S extends Comparable>public XyDataset<X,S> withLowerDomainInterval(Function<X,X> lowerIntervalFunction)
XyDatasetwithLowerDomainInterval in interface XyDataset<X extends Comparable,S extends Comparable>lowerIntervalFunction - the lower domain interval functionpublic XyDataset<X,S> withUpperDomainInterval(Function<X,X> upperIntervalFunction)
XyDatasetwithUpperDomainInterval in interface XyDataset<X extends Comparable,S extends Comparable>upperIntervalFunction - the upper domain interval functionClass<X> getDomainKeyType()
public Iterable<X> getDomainValues()
public Iterable<S> getSeriesKeys()
public int getSeriesCount()
public S getSeriesKey(int series)
series - the series indexpublic int getDomainSize()
public X getDomainValue(int item)
item - the item indexpublic double getRangeValue(int item,
int series)
item - the item indexseries - the series indexpublic void accept(JsCode script)
private Function<Object,String> createDomainFunction(Class<?> dataType)
dataType - the data typepublic static void main(String[] args)
Copyright 2014-2017, Xavier Witdouck