[New] Added StrolchTimedState.size()

This commit is contained in:
Robert von Burg 2023-02-16 17:02:48 +01:00
parent a9e895b2c0
commit 8f71812654
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
2 changed files with 12 additions and 0 deletions

View File

@ -145,6 +145,13 @@ public interface ITimeVariable<T extends IValue> {
*/
void setReadonly();
/**
* Returns the number of values stored on this time variable
*
* @return the number of values stored on this time variable
*/
int size();
/**
* Returns true if the given {@link ITimeVariable} is equal to this {@link ITimeVariable} by validating that the
* values {@link IValue IValues} have the same time and actual value

View File

@ -36,6 +36,11 @@ public class TimeVariable<T extends IValue> implements ITimeVariable<T>, Seriali
public NavigableSet<ITimeValue<T>> container = new TreeSet<>();
private boolean readonly;
@Override
public int size() {
return this.container.size();
}
@Override
public ITimeValue<T> getValueAt(long time) {
return this.container.floor(new TimeValue<>(time, null));