-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d7dac1b
commit a1bc0c7
Showing
8 changed files
with
81 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/org/rumbledb/runtime/functions/datetime/TimeInMillis.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.rumbledb.runtime.functions.datetime; | ||
|
||
import org.rumbledb.api.Item; | ||
import org.rumbledb.context.DynamicContext; | ||
import org.rumbledb.context.RuntimeStaticContext; | ||
import org.rumbledb.items.ItemFactory; | ||
import org.rumbledb.runtime.AtMostOneItemLocalRuntimeIterator; | ||
import org.rumbledb.runtime.RuntimeIterator; | ||
|
||
import java.util.List; | ||
|
||
public class TimeInMillis extends AtMostOneItemLocalRuntimeIterator { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
public TimeInMillis( | ||
List<RuntimeIterator> arguments, | ||
RuntimeStaticContext staticContext | ||
) { | ||
super(arguments, staticContext); | ||
} | ||
|
||
@Override | ||
public Item materializeFirstItemOrNull(DynamicContext context) { | ||
long time = System.currentTimeMillis(); | ||
return ItemFactory.getInstance().createLongItem(time); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters