Index index = new Index(); index.addProperty(property1); index.addProperty(property2); entity.addIndex(index);
Index indexUnique = new Index(); indexUnique.addProperty(project_type); indexUnique.addProperty(name); indexUnique.makeUnique(); projectsEntity.addIndex(indexUnique);
SwingUtilities.invokeLater(new Runnable() { public void run() { new Index(); } });
/** * Constructs a "mock" Index using the passed values. All passed values MUST NOT BE MODIFIED AFTER THIS CALL. * Otherwise the resulting object would not conform to the contract outlined above. Also, to conform to the * memory efficiency contract this method should be passed componentized DotNames, which all share common root * instances. Of course for testing code this doesn't really matter. * * @param annotations A map to lookup annotation instances by class name * @param subclasses A map to lookup subclasses by super class name * @param implementors A map to lookup implementing classes by interface name * @param classes A map to lookup classes by class name * @return the index */ public static Index create(Map<DotName, List<AnnotationInstance>> annotations, Map<DotName, List<ClassInfo>> subclasses, Map<DotName, List<ClassInfo>> implementors, Map<DotName, ClassInfo> classes) { return new Index(annotations, subclasses, implementors, classes); }
SortedMap<Index, Object> entries = new TreeMap<Index, Object>(); entries.put(new Index(1, 4), "1-4"); entries.put(new Index(5555555555l, 767777777777l), "5555555555l-767777777777l"); System.out.println(entries.size()); System.out.println(entries.get(new Index(1, 4))); System.out.println(entries.get(new Index(5555555555l, 767777777777l)));
var a = new Index(); // A console.log('a = ' + a.inc(24).inc().inc()); // Y, Z, A1 var b = new Index('B8'); // B8
Entity entity = schema.addEntity("TableName"); entity.addIdProperty().primaryKey().autoincrement(); Property firstIdForTableNamePK = entity.addStringProperty("firstId").notNull().getProperty(); Property secondIdForTableNamePK = entity.addStringProperty("secondId").notNull().getProperty(); Index indexUnique = new Index(); indexUnique.addProperty(firstIdForTableNamePK); indexUnique.addProperty(secondIdForTableNamePK); indexUnique.makeUnique(); entity.addIndex(indexUnique);
private Index readClasses(PackedDataInputStream stream, int annotationsSize, int implementorsSize, int subclassesSize) throws IOException { int classesSize = stream.readPackedU32(); HashMap<DotName, ClassInfo> classes = new HashMap<DotName, ClassInfo>(classesSize); HashMap<DotName, List<ClassInfo>> subclasses = new HashMap<DotName, List<ClassInfo>>(subclassesSize); HashMap<DotName, List<ClassInfo>> implementors = new HashMap<DotName, List<ClassInfo>>(implementorsSize); HashMap<DotName, List<AnnotationInstance>> masterAnnotations = new HashMap<DotName, List<AnnotationInstance>>(annotationsSize); for (int i = 0; i < classesSize; i++) { ClassInfo clazz = readClassEntry(stream, masterAnnotations); addClassToMap(subclasses, clazz.superName(), clazz); for (Type interfaceType : clazz.interfaceTypeArray()) { addClassToMap(implementors, interfaceType.name(), clazz); } classes.put(clazz.name(), clazz); } return new Index(masterAnnotations, subclasses, implementors, classes); }