use of com.google.api.ads.admanager.jaxws.v202205.Date in project algorithms-sedgewick-wayne by reneargento.
the class Exercise16 method readAllDates.
private static Date[] readAllDates(String fileName) {
In in = new In(fileName);
Queue<Date> queue = new Queue<>();
while (!in.isEmpty()) {
queue.enqueue(new Date(in.readString()));
}
int n = queue.size();
Date[] dates = new Date[n];
for (int i = 0; i < n; i++) {
dates[i] = queue.dequeue();
}
return dates;
}
use of com.google.api.ads.admanager.jaxws.v202205.Date in project algorithms-sedgewick-wayne by reneargento.
the class Exercise16 method main.
public static void main(String[] args) {
String dateFilePath = args[0];
Date[] dates = readAllDates(dateFilePath);
for (Date date : dates) {
StdOut.println(date);
}
}
use of com.google.api.ads.admanager.jaxws.v202205.Date in project algorithms-sedgewick-wayne by reneargento.
the class Exercise19_2_Parsing method main.
public static void main(String[] args) {
Date date = new Date(8, 5, 2016);
Exercise19_2_Parsing transaction = new Exercise19_2_Parsing("Turing", date, 22.10);
StdOut.println(transaction);
StdOut.println("Expected: Turing spent 22.1 on 8/5/2016");
}
use of com.google.api.ads.admanager.jaxws.v202205.Date in project googleads-java-lib by googleads.
the class PqlTest method testCreateValue_dateSet.
@Test
public void testCreateValue_dateSet() {
Set<Date> numberSet = new LinkedHashSet<Date>();
numberSet.add(date1);
Value value1 = ((SetValue) Pql.createValue(numberSet)).getValues().get(0);
assertEquals("2012-12-02", DateTimes.toString(((DateValue) value1).getValue()));
}
use of com.google.api.ads.admanager.jaxws.v202205.Date in project googleads-java-lib by googleads.
the class PqlTest method setUp.
@Before
public void setUp() throws Exception {
column1 = new ColumnType();
column1.setLabelName("column1");
column2 = new ColumnType();
column2.setLabelName("column2");
column3 = new ColumnType();
column3.setLabelName("column3");
textValue1 = new TextValue();
textValue1.setValue("value1");
textValue2 = new TextValue();
textValue2.setValue("value2");
textValue3 = new TextValue();
textValue3.setValue("value3");
textValue4 = new TextValue();
textValue4.setValue("comma,separated");
booleanValue1 = new BooleanValue();
booleanValue1.setValue(false);
booleanValue2 = new BooleanValue();
booleanValue2.setValue(true);
booleanValue3 = new BooleanValue();
booleanValue3.setValue(false);
numberValue1 = new NumberValue();
numberValue1.setValue("1");
numberValue2 = new NumberValue();
numberValue2.setValue("1.02");
numberValue3 = new NumberValue();
numberValue3.setValue("-1");
dateTime1 = new DateTime();
date1 = new Date();
date1.setYear(2012);
date1.setMonth(12);
date1.setDay(2);
dateTime1.setDate(date1);
dateTime1.setHour(12);
dateTime1.setMinute(45);
dateTime1.setSecond(0);
dateTime1.setTimeZoneId(TIME_ZONE_ID1);
dateTimeValue1 = new DateTimeValue();
dateTimeValue1.setValue(dateTime1);
dateValue1 = new DateValue();
dateValue1.setValue(date1);
AdUnitTargeting adUnitTargeting = new AdUnitTargeting();
adUnitTargeting.setAdUnitId("100");
InventoryTargeting inventoryTargeting = new InventoryTargeting();
inventoryTargeting.getTargetedAdUnits().add(adUnitTargeting);
targeting1 = new Targeting();
targeting1.setInventoryTargeting(inventoryTargeting);
targetingValue1 = new TargetingValue();
targetingValue1.setValue(targeting1);
numberSetValue = new SetValue();
numberSetValue.getValues().add(numberValue1);
numberSetValue.getValues().add(numberValue3);
textSetValue = new SetValue();
textSetValue.getValues().add(textValue1);
textSetValue.getValues().add(textValue2);
dateSetValue = new SetValue();
dateSetValue.getValues().add(dateValue1);
dateTimeSetValue = new SetValue();
dateTimeSetValue.getValues().add(dateTimeValue1);
mixedSetValue = new SetValue();
mixedSetValue.getValues().add(textValue1);
mixedSetValue.getValues().add(dateTimeValue1);
commaTextSetValue = new SetValue();
commaTextSetValue.getValues().add(textValue1);
commaTextSetValue.getValues().add(textValue4);
}
Aggregations