Пример #1
0
 private int createNewLabelId(String stringKey) {
   LabelTokenStore labelTokenStore = neoStore.getLabelTokenStore();
   int keyId = (int) labelTokenStore.nextId();
   LabelTokenRecord record = new LabelTokenRecord(keyId);
   record.setInUse(true);
   record.setCreated();
   Collection<DynamicRecord> keyRecords =
       labelTokenStore.allocateNameRecords(encodeString(stringKey));
   record.setNameId((int) first(keyRecords).getId());
   record.addNameRecords(keyRecords);
   labelTokenStore.updateRecord(record);
   labelTokens.addToken(stringKey, keyId);
   return keyId;
 }
Пример #2
0
 @Override
 public String toString() {
   return record.toString();
 }
Пример #3
0
 LabelToken(LabelTokenRecord record) {
   this.id = record.getId();
 }
Пример #4
0
 public LabelTokenCommand init(LabelTokenRecord record) {
   setup(record.getId(), Mode.fromRecordState(record));
   this.record = record;
   return this;
 }