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: 
The following works for me (Drupal 7.10):

```
'day' => array(
  'mysql_type' => 'DATETIME',
  'not null' => TRUE,
)

```

(notice the `mysql_type` key *instead of* `type`)

From the [Schema docs](http://api.drupal.org/api/drupal/includes--database--schema.inc/group/schemaapi/7):

> If you need to use a record type not included in the officially supported list of types above, you can specify a type for each database backend. In this case, you can leave out the type parameter

`datetime` is not an allowed generic type in Drupal 7 so leaving the `type` key in there will always cause an error.
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;
  }

```