11package org .rumbledb .api ;
22
3- import com .esotericsoftware .kryo .KryoSerializable ;
43import org .apache .spark .api .java .JavaRDD ;
54import org .apache .spark .ml .Estimator ;
65import org .apache .spark .ml .Transformer ;
1211import org .rumbledb .context .Name ;
1312import org .rumbledb .exceptions .DuplicateObjectKeyException ;
1413import org .rumbledb .exceptions .OurBadException ;
15- import org .rumbledb .items .structured .JSoundDataFrame ;
14+ import org .rumbledb .items .structured .HomogeneousItemDataFrame ;
1615import org .rumbledb .items .xml .XMLDocumentPosition ;
1716import org .rumbledb .runtime .flwor .NativeClauseContext ;
1817import org .rumbledb .runtime .RuntimeIterator ;
4342 *
4443 * @author Ghislain Fourny, Stefan Irimescu, Can Berker Cikis
4544 */
46- public interface Item extends Serializable , KryoSerializable {
45+ public interface Item extends Serializable {
4746
4847 /**
4948 * Makes a copy.
@@ -516,17 +515,6 @@ default boolean isObject() {
516515 return false ;
517516 }
518517
519- /**
520- * Returns the string keys of the item, if it is a map.
521- *
522- * @return the list of the keys.
523- * @deprecated use {@link #getStringKeys()} instead
524- */
525- @ Deprecated
526- default List <String > getKeys () {
527- return this .getStringKeys ();
528- }
529-
530518 /**
531519 * Returns the string keys of the item, if it is a map.
532520 *
@@ -548,17 +536,6 @@ default List<Item> getItemKeys() throws UnsupportedOperationException {
548536 throw new UnsupportedOperationException ("Operation not defined for type " + this .getDynamicType ());
549537 }
550538
551- /**
552- * Returns the values of the item, if it is a map.
553- *
554- * @return the list of the value items.
555- * @deprecated use {@link #getItemValues()} instead
556- */
557- @ Deprecated
558- default List <Item > getValues () {
559- return this .getItemValues ();
560- }
561-
562539 /**
563540 * Returns the values of the item, if it is a map.
564541 *
@@ -784,17 +761,6 @@ default boolean hasKey(Item key) throws UnsupportedOperationException {
784761 throw new UnsupportedOperationException ("Operation not defined for type " + this .getDynamicType ());
785762 }
786763
787- /**
788- * Returns the members of the item if it is an array.
789- *
790- * @return the list of the array members.
791- * @deprecated use {@link #getItemMembers()} instead
792- */
793- @ Deprecated
794- default List <Item > getItems () {
795- return this .getItemMembers ();
796- }
797-
798764 /**
799765 * Returns the members of the item, if it is an array.
800766 *
@@ -846,17 +812,6 @@ default List<Item> getSequenceAt(int position)
846812 throw new UnsupportedOperationException ("Operation not defined for type " + this .getDynamicType ());
847813 }
848814
849- /**
850- * Appends an item to the item, if it is an array.
851- *
852- * @param item the item to append.
853- * @throws UnsupportedOperationException if the item is not an array.
854- * @deprecated use {@link #appendItem(Item)} instead
855- */
856- default void append (Item item ) throws UnsupportedOperationException {
857- this .appendItem (item );
858- }
859-
860815 /**
861816 * Appends an item to the item, if it is an array.
862817 *
@@ -1032,6 +987,18 @@ default Duration getDurationValue() {
1032987 throw new UnsupportedOperationException ("Operation not defined for type " + this .getDynamicType ());
1033988 }
1034989
990+ /**
991+ * Returns the day-time (seconds) component of a duration item, i.e., the value of the
992+ * duration excluding its months component. Unlike getDurationValue(), this is not
993+ * anchored to any reference date, since days, hours, minutes and seconds have a fixed
994+ * length and can be converted to a Duration unambiguously.
995+ *
996+ * @return the day-time component as a Duration.
997+ */
998+ default Duration getDayTimeDurationComponent () {
999+ throw new UnsupportedOperationException ("Operation not defined for type " + this .getDynamicType ());
1000+ }
1001+
10351002 /**
10361003 * Returns the EpochMillis of the item, if it's DateTime or Duration
10371004 * It will collect all the parts of the item and compress it into the EpochMillis
@@ -1137,7 +1104,7 @@ default Map<Name, JavaRDD<Item>> getRDDVariablesInClosure() {
11371104 *
11381105 * @return the function signature.
11391106 */
1140- default Map <Name , JSoundDataFrame > getDFVariablesInClosure () {
1107+ default Map <Name , HomogeneousItemDataFrame > getDFVariablesInClosure () {
11411108 throw new UnsupportedOperationException ("Operation not defined for type " + this .getDynamicType ());
11421109 }
11431110
0 commit comments