Question: I created a singly linked list in java. This list has the property that the first item pushed is the last item that will be popped. 

The popping performance is nice compared to the Queue. I like to improve the push performance. Instead of prepending I also tried appending in the push method, this didn't improve the performance.

Do you guys have any idea how to improve this list?

Push-Pop performance (Stack, ArrayList and Queue are the java.util implementations):

10 million integers averaged over 10 runs

* Stack filling: 776.3ms
* Stack popping: 207.2ms
* ArrayList filling: 574.0ms
* ArrayList popping: 35.3ms
* Queue filling: 2642.2ms
* Queue popping: 96.9ms
* MyList filling: 4811.2ms
* MyList popping: 50.5ms

```java
public class MyList<T> {
    T head = null;
    MyList<T> tail = null;
    boolean isNil = true;

    public T pop() {
        if(isNil) {
            return null;
        }
        else if(this.tail.isNil) {
            this.isNil = true;
            return head;
        }
        else {
            T head = this.head;
            this.head = this.tail.head;
            this.tail = this.tail.tail;
            return head;
        }
    }

    public void push(T element) {
        MyList<T> item = new MyList<T>();
        item.head = this.head;
        item.tail = this.tail;
        item.isNil = this.isNil;
        this.head = element;
        this.tail = item;
        this.isNil = false;
    }
}

```

Answer: 
If you look in the schema of the Date module you will find something like

```
'day' => array(
    'type' => 'datetime',
    'mysql_type' => 'datetime',
)

```

Actually the answer of Clive was the one i picked first but later gave me problems with the Views module.

This implementation of the Date module save my day
The Date contrib module has:

```
function date_field_schema($field) {
  $db_columns = array();
  switch ($field['type']) {
    case 'datestamp':
      $db_columns['value'] = array(
        'type' => 'int',
        'not null' => FALSE,
        'sortable' => TRUE,
        'views' => TRUE,
      );
      break;

    case 'datetime':
      $db_columns['value'] = array(
        'type' => 'datetime',
        'mysql_type' => 'datetime',
        'pgsql_type' => 'timestamp without time zone',
        'sqlite_type' => 'varchar',
        'sqlsrv_type' => 'smalldatetime',
        'not null' => FALSE,
        'sortable' => TRUE,
        'views' => TRUE,
      );
      break;

    default:
      $db_columns['value'] = array(
        'type' => 'varchar',
        'length' => 20,
        'not null' => FALSE,
        'sortable' => TRUE,
        'views' => TRUE,
      );
      break;
  }

```