1 package net.jaekl.cfb.db;
3 // Copyright (C) 2015 Christian Jaekl
7 CHAR, INTEGER, TIMESTAMP, TIMESTAMPTZ, VARCHAR
18 public Column(String name, Type type, int width, Null canBeNull)
26 public String getName() { return m_name; }
27 public Type getType() { return m_type; }
28 public int getWidth() { return m_width; }
29 public Null getNull() { return m_null; }
31 // Create a column based on an array of Objects
32 // Input format: { name, type, width, can_be_null }
33 public static Column construct(Object[] spec) {
35 assert(4 == spec.length);
36 assert(spec[0] instanceof String);
37 assert(spec[1] instanceof Type);
38 assert(spec[2] instanceof Number);
39 assert(spec[3] instanceof Null);
41 String name = (String)(spec[0]);
42 Type type = (Type)(spec[1]);
43 Number width = (Number)(spec[2]);
44 Null canBeNull = (Null)(spec[3]);
46 return new Column(name, type, width.intValue(), canBeNull);